// source --> https://crmtiger.com/wp-content/plugins/wp-video-lightbox/js/video-lightbox.js?ver=3.1.6 jQuery(document).ready(function ($) { //WP Video Lightbox Plugin - http://www.tipsandtricks-hq.com/?p=2700 $("a[rel^=" + vlpp_vars.prettyPhoto_rel + "]").prettyPhoto({ hook: "rel", animation_speed: vlpp_vars.animation_speed, ajaxcallback: function () {}, slideshow: (vlpp_vars.slideshow == "false") ? false : vlpp_vars.slideshow, autoplay_slideshow: (vlpp_vars.autoplay_slideshow == "true") ? true : false, opacity: vlpp_vars.opacity, show_title: (vlpp_vars.show_title == "true") ? true : false, allow_resize: (vlpp_vars.allow_resize == "true") ? true : false, allow_expand: (vlpp_vars.allow_expand == "true") ? true : false, default_width: vlpp_vars.default_width, default_height: vlpp_vars.default_height, counter_separator_label: vlpp_vars.counter_separator_label, theme: vlpp_vars.theme, horizontal_padding: vlpp_vars.horizontal_padding, hideflash: (vlpp_vars.hideflash == "true") ? true : false, wmode: vlpp_vars.wmode, autoplay: (vlpp_vars.autoplay == "true") ? true : false, modal: (vlpp_vars.modal == "true") ? true : false, deeplinking: (vlpp_vars.deeplinking == "true") ? true : false, overlay_gallery: (vlpp_vars.overlay_gallery == "true") ? true : false, overlay_gallery_max: vlpp_vars.overlay_gallery_max, keyboard_shortcuts: (vlpp_vars.keyboard_shortcuts == "true") ? true : false, changepicturecallback: function () {}, callback: function () {}, ie6_fallback: (vlpp_vars.ie6_fallback == "true") ? true : false, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\ {pp_social} \ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: false }); }); // source --> https://crmtiger.com/wp-content/plugins/vc-hover-pack-pro/js/wow.min.js?ver=4.3.26 /*! WOW - v1.1.2 - 2015-08-19 * Copyright (c) 2015 Matthieu Aussaguel; Licensed MIT */(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.createEvent=function(a,b,c,d){var e;return null==b&&(b=!1),null==c&&(c=!1),null==d&&(d=null),null!=document.createEvent?(e=document.createEvent("CustomEvent"),e.initCustomEvent(a,b,c,d)):null!=document.createEventObject?(e=document.createEventObject(),e.eventType=a):e.eventName=a,e},a.prototype.emitEvent=function(a,b){return null!=a.dispatchEvent?a.dispatchEvent(b):b in(null!=a)?a[b]():"on"+b in(null!=a)?a["on"+b]():void 0},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]},a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.resetAnimation=f(this.resetAnimation,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),null!=a.scrollContainer&&(this.config.scrollContainer=document.querySelector(a.scrollContainer)),this.animationNameCache=new c,this.wowEvent=this.util().createEvent(this.config.boxClass)}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null,scrollContainer:null},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],c=0,d=b.length;d>c;c++)f=b[c],g.push(function(){var a,b,c,d;for(c=f.addedNodes||[],d=[],a=0,b=c.length;b>a;a++)e=c[a],d.push(this.doSync(e));return d}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=a.className+" "+this.config.animateClass,null!=this.config.callback&&this.config.callback(a),this.util().emitEvent(a,this.wowEvent),this.util().addEvent(a,"animationend",this.resetAnimation),this.util().addEvent(a,"oanimationend",this.resetAnimation),this.util().addEvent(a,"webkitAnimationEnd",this.resetAnimation),this.util().addEvent(a,"MSAnimationEnd",this.resetAnimation),a},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.resetAnimation=function(a){var b;return a.type.toLowerCase().indexOf("animationend")>=0?(b=a.target||a.srcElement,b.className=b.className.replace(this.config.animateClass,"").trim()):void 0},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;d=[];for(c in b)e=b[c],a[""+c]=e,d.push(function(){var b,d,g,h;for(g=this.vendors,h=[],b=0,d=g.length;d>b;b++)f=g[b],h.push(a[""+f+c.charAt(0).toUpperCase()+c.substr(1)]=e);return h}.call(this));return d},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(h=d(a),g=h.getPropertyCSSValue(b),f=this.vendors,c=0,e=f.length;e>c;c++)i=f[c],g=g||h.getPropertyCSSValue("-"+i+"-"+b);return g},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=this.config.scrollContainer&&this.config.scrollContainer.scrollTop||window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this); // source --> https://crmtiger.com/wp-content/plugins/vc-hover-pack-pro/js/admin.js?ver=4.3.26 jQuery(document).ready(function($) { var wow = new WOW( { boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true, // act on asynchronously loaded content (default is true) callback: function(box) { // the callback is fired every time an animation is started // the argument that is passed in is the DOM node being animated }, scrollContainer: null // optional scroll container selector, otherwise use window } ); wow.init(); jQuery('.animate').addClass('animated slideOutLeft'); }); // source --> https://crmtiger.com/wp-content/plugins/woo-product-gallery-slider/public/js/owl.carousel.min.js?ver=1 !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this.drag=a.extend({},m),this.state=a.extend({},n),this.e=a.extend({},o),this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._invalidated={},this._pipe=[],a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a[0].toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Pipe,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}function f(a){if(a.touches!==d)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(a.touches===d){if(a.pageX!==d)return{x:a.pageX,y:a.pageY};if(a.pageX===d)return{x:a.clientX,y:a.clientY}}}function g(a){var b,d,e=c.createElement("div"),f=a;for(b in f)if(d=f[b],"undefined"!=typeof e.style[d])return e=null,[d,b];return[!1]}function h(){return g(["transition","WebkitTransition","MozTransition","OTransition"])[1]}function i(){return g(["transform","WebkitTransform","MozTransform","OTransform","msTransform"])[0]}function j(){return g(["perspective","webkitPerspective","MozPerspective","OPerspective","MsPerspective"])[0]}function k(){return"ontouchstart"in b||!!navigator.msMaxTouchPoints}function l(){return b.navigator.msPointerEnabled}var m,n,o;m={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},n={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},o={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,responsiveClass:!1,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",themeClass:"owl-theme",baseClass:"owl-carousel",itemClass:"owl-item",centerClass:"center",activeClass:"active"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Plugins={},e.Pipe=[{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){var a=this._clones,b=this.$stage.children(".cloned");(b.length!==a.length||!this.settings.loop&&a.length>0)&&(this.$stage.children(".cloned").remove(),this._clones=[])}},{filter:["items","settings"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass("cloned")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass("cloned")))}},{filter:["width","items","settings"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:["width","items","settings"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,"padding-left":this.settings.stagePadding||"","padding-right":this.settings.stagePadding||""};if(this.$stage.css(e),e={width:this.settings.autoWidth?"auto":d-this.settings.margin},e[this.settings.rtl?"margin-left":"margin-right"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:["width","items","settings"],run:function(a){a.current&&this.reset(this.$stage.children().index(a.current))}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children("."+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children("."+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger("initialize"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass("owl-loading"),this.$stage=a("<"+this.settings.stageElement+' class="owl-stage"/>').wrap('
'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='
',d=k.lazyLoad?'
':'
',b.after(d),b.after(e)};return b.wrap('
"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a('
'+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay() },this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("
").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document); // source --> https://crmtiger.com/wp-content/plugins/woo-product-gallery-slider/public/js/woocommerce-product-gallery-slider-public.js?ver=1 (function( $ ) { 'use strict'; /** * All of the code for your public-facing JavaScript source * should reside in this file. * * Note that this assume you're going to use jQuery, so it prepares * the $ function reference to be used within the scope of this * function. * * From here, you're able to define handlers for when the DOM is * ready: * * $(function() { * * }); * * Or when the window is loaded: * * $( window ).load(function() { * * }); * * ...and so on. * * Remember that ideally, we should not attach any more than a single DOM-ready or window-load handler * for any particular page. Though other scripts in WordPress core, other plugins, and other themes may * be doing this, we should try to minimize doing that in our own work. */ $( document ).ready(function() { }); })( jQuery ); // source --> https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/helper-plugins/jquery.ba-throttle-debounce.min.js?ver=4.3.26 /* * jQuery throttle / debounce - v1.1 - 3/7/2010 * http://benalman.com/projects/jquery-throttle-debounce-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); // source --> https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/helper-plugins/jquery.mousewheel.min.js?ver=4.3.26 /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); // source --> https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/helper-plugins/jquery.touchSwipe.min.js?ver=4.3.26 /* * touchSwipe - jQuery Plugin * https://github.com/mattbryson/TouchSwipe-Jquery-Plugin * http://labs.skinkers.com/touchSwipe/ * http://plugins.jquery.com/project/touchSwipe * * Copyright (c) 2010 Matt Bryson (www.skinkers.com) * Dual licensed under the MIT or GPL Version 2 licenses. * * $version: 1.3.3 */ (function(g){function P(c){if(c&&void 0===c.allowPageScroll&&(void 0!==c.swipe||void 0!==c.swipeStatus))c.allowPageScroll=G;c||(c={});c=g.extend({},g.fn.swipe.defaults,c);return this.each(function(){var b=g(this),f=b.data(w);f||(f=new W(this,c),b.data(w,f))})}function W(c,b){var f,p,r,s;function H(a){var a=a.originalEvent,c,Q=n?a.touches[0]:a;d=R;n?h=a.touches.length:a.preventDefault();i=0;j=null;k=0;!n||h===b.fingers||b.fingers===x?(r=f=Q.pageX,s=p=Q.pageY,y=(new Date).getTime(),b.swipeStatus&&(c= l(a,d))):t(a);if(!1===c)return d=m,l(a,d),c;e.bind(I,J);e.bind(K,L)}function J(a){a=a.originalEvent;if(!(d===q||d===m)){var c,e=n?a.touches[0]:a;f=e.pageX;p=e.pageY;u=(new Date).getTime();j=S();n&&(h=a.touches.length);d=z;var e=a,g=j;if(b.allowPageScroll===G)e.preventDefault();else{var o=b.allowPageScroll===T;switch(g){case v:(b.swipeLeft&&o||!o&&b.allowPageScroll!=M)&&e.preventDefault();break;case A:(b.swipeRight&&o||!o&&b.allowPageScroll!=M)&&e.preventDefault();break;case B:(b.swipeUp&&o||!o&&b.allowPageScroll!= N)&&e.preventDefault();break;case C:(b.swipeDown&&o||!o&&b.allowPageScroll!=N)&&e.preventDefault()}}h===b.fingers||b.fingers===x||!n?(i=U(),k=u-y,b.swipeStatus&&(c=l(a,d,j,i,k)),b.triggerOnTouchEnd||(e=!(b.maxTimeThreshold?!(k>=b.maxTimeThreshold):1),!0===D()?(d=q,c=l(a,d)):e&&(d=m,l(a,d)))):(d=m,l(a,d));!1===c&&(d=m,l(a,d))}}function L(a){a=a.originalEvent;a.preventDefault();u=(new Date).getTime();i=U();j=S();k=u-y;if(b.triggerOnTouchEnd||!1===b.triggerOnTouchEnd&&d===z)if(d=q,(h===b.fingers||b.fingers=== x||!n)&&0!==f){var c=!(b.maxTimeThreshold?!(k>=b.maxTimeThreshold):1);if((!0===D()||null===D())&&!c)l(a,d);else if(c||!1===D())d=m,l(a,d)}else d=m,l(a,d);else d===z&&(d=m,l(a,d));e.unbind(I,J,!1);e.unbind(K,L,!1)}function t(){y=u=p=f=s=r=h=0}function l(a,c){var d=void 0;b.swipeStatus&&(d=b.swipeStatus.call(e,a,c,j||null,i||0,k||0,h));if(c===m&&b.click&&(1===h||!n)&&(isNaN(i)||0===i))d=b.click.call(e,a,a.target);if(c==q)switch(b.swipe&&(d=b.swipe.call(e,a,j,i,k,h)),j){case v:b.swipeLeft&&(d=b.swipeLeft.call(e, a,j,i,k,h));break;case A:b.swipeRight&&(d=b.swipeRight.call(e,a,j,i,k,h));break;case B:b.swipeUp&&(d=b.swipeUp.call(e,a,j,i,k,h));break;case C:b.swipeDown&&(d=b.swipeDown.call(e,a,j,i,k,h))}(c===m||c===q)&&t(a);return d}function D(){return null!==b.threshold?i>=b.threshold:null}function U(){return Math.round(Math.sqrt(Math.pow(f-r,2)+Math.pow(p-s,2)))}function S(){var a;a=Math.atan2(p-s,r-f);a=Math.round(180*a/Math.PI);0>a&&(a=360-Math.abs(a));return 45>=a&&0<=a?v:360>=a&&315<=a?v:135<=a&&225>=a? A:45a?C:B}function V(){e.unbind(E,H);e.unbind(F,t);e.unbind(I,J);e.unbind(K,L)}var O=n||!b.fallbackToMouseEvents,E=O?"touchstart":"mousedown",I=O?"touchmove":"mousemove",K=O?"touchend":"mouseup",F="touchcancel",i=0,j=null,k=0,e=g(c),d="start",h=0,y=p=f=s=r=0,u=0;try{e.bind(E,H),e.bind(F,t)}catch(P){g.error("events not supported "+E+","+F+" on jQuery.swipe")}this.enable=function(){e.bind(E,H);e.bind(F,t);return e};this.disable=function(){V();return e};this.destroy=function(){V();e.data(w,null); return e}}var v="left",A="right",B="up",C="down",G="none",T="auto",M="horizontal",N="vertical",x="all",R="start",z="move",q="end",m="cancel",n="ontouchstart"in window,w="TouchSwipe";g.fn.swipe=function(c){var b=g(this),f=b.data(w);if(f&&"string"===typeof c){if(f[c])return f[c].apply(this,Array.prototype.slice.call(arguments,1));g.error("Method "+c+" does not exist on jQuery.swipe")}else if(!f&&("object"===typeof c||!c))return P.apply(this,arguments);return b};g.fn.swipe.defaults={fingers:1,threshold:75, maxTimeThreshold:null,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,click:null,triggerOnTouchEnd:!0,allowPageScroll:"auto",fallbackToMouseEvents:!0};g.fn.swipe.phases={PHASE_START:R,PHASE_MOVE:z,PHASE_END:q,PHASE_CANCEL:m};g.fn.swipe.directions={LEFT:v,RIGHT:A,UP:B,DOWN:C};g.fn.swipe.pageScroll={NONE:G,HORIZONTAL:M,VERTICAL:N,AUTO:T};g.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:x}})(jQuery); // source --> https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/helper-plugins/jquery.transit.min.js?ver=4.3.26 /*! * jQuery Transit - CSS3 transitions and transformations * (c) 2011-2012 Rico Sta. Cruz * MIT Licensed. * * http://ricostacruz.com/jquery.transit * http://github.com/rstacruz/jquery.transit */ (function(d){function m(a){if(a in j.style)return a;var b=["Moz","Webkit","O","ms"],c=a.charAt(0).toUpperCase()+a.substr(1);if(a in j.style)return a;for(a=0;ad.fn.jquery&&(d.cssHooks.transformOrigin={get:function(a){return a.style[e.transformOrigin]},set:function(a,b){a.style[e.transformOrigin]=b}},d.cssHooks.transition={get:function(a){return a.style[e.transition]},set:function(a,b){a.style[e.transition]=b}});f("scale"); f("translate");f("rotate");f("rotateX");f("rotateY");f("rotate3d");f("perspective");f("skewX");f("skewY");f("x",!0);f("y",!0);l.prototype={setFromString:function(a,b){var c="string"===typeof b?b.split(","):b.constructor===Array?b:[b];c.unshift(a);l.prototype.set.apply(this,c)},set:function(a){var b=Array.prototype.slice.apply(arguments,[1]);this.setter[a]?this.setter[a].apply(this,b):this[a]=b.join(",")},get:function(a){return this.getter[a]?this.getter[a].apply(this):this[a]||0},setter:{rotate:function(a){this.rotate= g(a,"deg")},rotateX:function(a){this.rotateX=g(a,"deg")},rotateY:function(a){this.rotateY=g(a,"deg")},scale:function(a,b){void 0===b&&(b=a);this.scale=a+","+b},skewX:function(a){this.skewX=g(a,"deg")},skewY:function(a){this.skewY=g(a,"deg")},perspective:function(a){this.perspective=g(a,"px")},x:function(a){this.set("translate",a,null)},y:function(a){this.set("translate",null,a)},translate:function(a,b){void 0===this._translateX&&(this._translateX=0);void 0===this._translateY&&(this._translateY=0); null!==a&&void 0!==a&&(this._translateX=g(a,"px"));null!==b&&void 0!==b&&(this._translateY=g(b,"px"));this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var a=(this.scale||"1,1").split(",");a[0]&&(a[0]=parseFloat(a[0]));a[1]&&(a[1]=parseFloat(a[1]));return a[0]===a[1]?a[0]:a},rotate3d:function(){for(var a=(this.rotate3d||"0,0,0,0deg").split(","),b=0;3>=b;++b)a[b]&&(a[b]=parseFloat(a[b])); a[3]&&(a[3]=g(a[3],"deg"));return a}},parse:function(a){var b=this;a.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(a,d,e){b.setFromString(d,e)})},toString:function(a){var b=[],c;for(c in this)if(this.hasOwnProperty(c)&&(e.transform3d||!("rotateX"===c||"rotateY"===c||"perspective"===c||"transformOrigin"===c)))"_"!==c[0]&&(a&&"scale"===c?b.push(c+"3d("+this[c]+",1)"):a&&"translate"===c?b.push(c+"3d("+this[c]+",0)"):b.push(c+"("+this[c]+")"));return b.join(" ")}};d.fn.transition=d.fn.transit=function(a, b,c,f){var h=this,g=0,j=!0;"function"===typeof b&&(f=b,b=void 0);"function"===typeof c&&(f=c,c=void 0);"undefined"!==typeof a.easing&&(c=a.easing,delete a.easing);"undefined"!==typeof a.duration&&(b=a.duration,delete a.duration);"undefined"!==typeof a.complete&&(f=a.complete,delete a.complete);"undefined"!==typeof a.queue&&(j=a.queue,delete a.queue);"undefined"!==typeof a.delay&&(g=a.delay,delete a.delay);"undefined"===typeof b&&(b=d.fx.speeds._default);"undefined"===typeof c&&(c=d.cssEase._default); b=n(b);var l=q(a,b,c,g),k=d.transit.enabled&&e.transition?parseInt(b,10)+parseInt(g,10):0;if(0===k)return b=j,c=function(b){h.css(a);f&&f.apply(h);b&&b()},!0===b?h.queue(c):b?h.queue(b,c):c(),h;var m={};b=j;c=function(b){this.offsetWidth;var c=!1,g=function(){c&&h.unbind(p,g);0 https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/jquery.carouFredSel-6.2.1.js?ver=4.3.26 /* * jQuery carouFredSel 6.2.1 * Demo's and documentation: * caroufredsel.dev7studios.com * * Copyright (c) 2013 Fred Heusschen * www.frebsite.nl * * Dual licensed under the MIT and GPL licenses. * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License */ (function($) { // LOCAL if ( $.fn.carouFredSel ) { return; } $.fn.caroufredsel = $.fn.carouFredSel = function(options, configs) { // no element if (this.length == 0) { debug( true, 'No element found for "' + this.selector + '".' ); return this; } // multiple elements if (this.length > 1) { return this.each(function() { $(this).carouFredSel(options, configs); }); } var $cfs = this, $tt0 = this[0], starting_position = false; if ($cfs.data('_cfs_isCarousel')) { starting_position = $cfs.triggerHandler('_cfs_triggerEvent', 'currentPosition'); $cfs.trigger('_cfs_triggerEvent', ['destroy', true]); } var FN = {}; FN._init = function(o, setOrig, start) { o = go_getObject($tt0, o); o.items = go_getItemsObject($tt0, o.items); o.scroll = go_getScrollObject($tt0, o.scroll); o.auto = go_getAutoObject($tt0, o.auto); o.prev = go_getPrevNextObject($tt0, o.prev); o.next = go_getPrevNextObject($tt0, o.next); o.pagination = go_getPaginationObject($tt0, o.pagination); o.swipe = go_getSwipeObject($tt0, o.swipe); o.mousewheel = go_getMousewheelObject($tt0, o.mousewheel); if (setOrig) { opts_orig = $.extend(true, {}, $.fn.carouFredSel.defaults, o); } opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o); opts.d = cf_getDimensions(opts); crsl.direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev'; var a_itm = $cfs.children(), avail_primary = ms_getParentSize($wrp, opts, 'width'); if (is_true(opts.cookie)) { opts.cookie = 'caroufredsel_cookie_' + conf.serialNumber; } opts.maxDimension = ms_getMaxDimension(opts, avail_primary); // complement items and sizes opts.items = in_complementItems(opts.items, opts, a_itm, start); opts[opts.d['width']] = in_complementPrimarySize(opts[opts.d['width']], opts, a_itm); opts[opts.d['height']] = in_complementSecondarySize(opts[opts.d['height']], opts, a_itm); // primary size not set for a responsive carousel if (opts.responsive) { if (!is_percentage(opts[opts.d['width']])) { opts[opts.d['width']] = '100%'; } } // primary size is percentage if (is_percentage(opts[opts.d['width']])) { crsl.upDateOnWindowResize = true; crsl.primarySizePercentage = opts[opts.d['width']]; opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage); if (!opts.items.visible) { opts.items.visibleConf.variable = true; } } if (opts.responsive) { opts.usePadding = false; opts.padding = [0, 0, 0, 0]; opts.align = false; opts.items.visibleConf.variable = false; } else { // visible-items not set if (!opts.items.visible) { opts = in_complementVisibleItems(opts, avail_primary); } // primary size not set -> calculate it or set to "variable" if (!opts[opts.d['width']]) { if (!opts.items.visibleConf.variable && is_number(opts.items[opts.d['width']]) && opts.items.filter == '*') { opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']]; opts.align = false; } else { opts[opts.d['width']] = 'variable'; } } // align not set -> set to center if primary size is number if (is_undefined(opts.align)) { opts.align = (is_number(opts[opts.d['width']])) ? 'center' : false; } // set variabe visible-items if (opts.items.visibleConf.variable) { opts.items.visible = gn_getVisibleItemsNext(a_itm, opts, 0); } } // set visible items by filter if (opts.items.filter != '*' && !opts.items.visibleConf.variable) { opts.items.visibleConf.org = opts.items.visible; opts.items.visible = gn_getVisibleItemsNextFilter(a_itm, opts, 0); } opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0); opts.items.visibleConf.old = opts.items.visible; if (opts.responsive) { if (!opts.items.visibleConf.min) { opts.items.visibleConf.min = opts.items.visible; } if (!opts.items.visibleConf.max) { opts.items.visibleConf.max = opts.items.visible; } opts = in_getResponsiveValues(opts, a_itm, avail_primary); } else { opts.padding = cf_getPadding(opts.padding); if (opts.align == 'top') { opts.align = 'left'; } else if (opts.align == 'bottom') { opts.align = 'right'; } switch (opts.align) { // align: center, left or right case 'center': case 'left': case 'right': if (opts[opts.d['width']] != 'variable') { opts = in_getAlignPadding(opts, a_itm); opts.usePadding = true; } break; // padding default: opts.align = false; opts.usePadding = ( opts.padding[0] == 0 && opts.padding[1] == 0 && opts.padding[2] == 0 && opts.padding[3] == 0 ) ? false : true; break; } } if (!is_number(opts.scroll.duration)) { opts.scroll.duration = 500; } if (is_undefined(opts.scroll.items)) { opts.scroll.items = (opts.responsive || opts.items.visibleConf.variable || opts.items.filter != '*') ? 'visible' : opts.items.visible; } opts.auto = $.extend(true, {}, opts.scroll, opts.auto); opts.prev = $.extend(true, {}, opts.scroll, opts.prev); opts.next = $.extend(true, {}, opts.scroll, opts.next); opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination); // swipe and mousewheel extend later on, per direction opts.auto = go_complementAutoObject($tt0, opts.auto); opts.prev = go_complementPrevNextObject($tt0, opts.prev); opts.next = go_complementPrevNextObject($tt0, opts.next); opts.pagination = go_complementPaginationObject($tt0, opts.pagination); opts.swipe = go_complementSwipeObject($tt0, opts.swipe); opts.mousewheel = go_complementMousewheelObject($tt0, opts.mousewheel); if (opts.synchronise) { opts.synchronise = cf_getSynchArr(opts.synchronise); } // DEPRECATED if (opts.auto.onPauseStart) { opts.auto.onTimeoutStart = opts.auto.onPauseStart; deprecated('auto.onPauseStart', 'auto.onTimeoutStart'); } if (opts.auto.onPausePause) { opts.auto.onTimeoutPause = opts.auto.onPausePause; deprecated('auto.onPausePause', 'auto.onTimeoutPause'); } if (opts.auto.onPauseEnd) { opts.auto.onTimeoutEnd = opts.auto.onPauseEnd; deprecated('auto.onPauseEnd', 'auto.onTimeoutEnd'); } if (opts.auto.pauseDuration) { opts.auto.timeoutDuration = opts.auto.pauseDuration; deprecated('auto.pauseDuration', 'auto.timeoutDuration'); } // /DEPRECATED }; // /init FN._build = function() { $cfs.data('_cfs_isCarousel', true); var a_itm = $cfs.children(), orgCSS = in_mapCss($cfs, ['textAlign', 'float', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'width', 'height', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft']), newPosition = 'relative'; switch (orgCSS.position) { case 'absolute': case 'fixed': newPosition = orgCSS.position; break; } if (conf.wrapper == 'parent') { sz_storeOrigCss($wrp); } else { $wrp.css(orgCSS); } $wrp.css({ 'overflow' : 'hidden', 'position' : newPosition }); sz_storeOrigCss($cfs); $cfs.data('_cfs_origCssZindex', orgCSS.zIndex); $cfs.css({ 'textAlign' : 'left', 'float' : 'none', 'position' : 'absolute', 'top' : 0, 'right' : 'auto', 'bottom' : 'auto', 'left' : 0, 'marginTop' : 0, 'marginRight' : 0, 'marginBottom' : 0, 'marginLeft' : 0 }); sz_storeMargin(a_itm, opts); sz_storeOrigCss(a_itm); if (opts.responsive) { sz_setResponsiveSizes(opts, a_itm); } }; // /build FN._bind_events = function() { FN._unbind_events(); // stop event $cfs.bind(cf_e('stop', conf), function(e, imm) { e.stopPropagation(); // button if (!crsl.isStopped) { if (opts.auto.button) { opts.auto.button.addClass(cf_c('stopped', conf)); } } // set stopped crsl.isStopped = true; if (opts.auto.play) { opts.auto.play = false; $cfs.trigger(cf_e('pause', conf), imm); } return true; }); // finish event $cfs.bind(cf_e('finish', conf), function(e) { e.stopPropagation(); if (crsl.isScrolling) { sc_stopScroll(scrl); } return true; }); // pause event $cfs.bind(cf_e('pause', conf), function(e, imm, res) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); // immediately pause if (imm && crsl.isScrolling) { scrl.isStopped = true; var nst = getTime() - scrl.startTime; scrl.duration -= nst; if (scrl.pre) { scrl.pre.duration -= nst; } if (scrl.post) { scrl.post.duration -= nst; } sc_stopScroll(scrl, false); } // update remaining pause-time if (!crsl.isPaused && !crsl.isScrolling) { if (res) { tmrs.timePassed += getTime() - tmrs.startTime; } } // button if (!crsl.isPaused) { if (opts.auto.button) { opts.auto.button.addClass(cf_c('paused', conf)); } } // set paused crsl.isPaused = true; // pause pause callback if (opts.auto.onTimeoutPause) { var dur1 = opts.auto.timeoutDuration - tmrs.timePassed, perc = 100 - Math.ceil( dur1 * 100 / opts.auto.timeoutDuration ); opts.auto.onTimeoutPause.call($tt0, perc, dur1); } return true; }); // play event $cfs.bind(cf_e('play', conf), function(e, dir, del, res) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); // sort params var v = [dir, del, res], t = ['string', 'number', 'boolean'], a = cf_sortParams(v, t); dir = a[0]; del = a[1]; res = a[2]; if (dir != 'prev' && dir != 'next') { dir = crsl.direction; } if (!is_number(del)) { del = 0; } if (!is_boolean(res)) { res = false; } // stopped? if (res) { crsl.isStopped = false; opts.auto.play = true; } if (!opts.auto.play) { e.stopImmediatePropagation(); return debug(conf, 'Carousel stopped: Not scrolling.'); } // button if (crsl.isPaused) { if (opts.auto.button) { opts.auto.button.removeClass(cf_c('stopped', conf)); opts.auto.button.removeClass(cf_c('paused', conf)); } } // set playing crsl.isPaused = false; tmrs.startTime = getTime(); // timeout the scrolling var dur1 = opts.auto.timeoutDuration + del; dur2 = dur1 - tmrs.timePassed; perc = 100 - Math.ceil(dur2 * 100 / dur1); if (opts.auto.progress) { tmrs.progress = setInterval(function() { var pasd = getTime() - tmrs.startTime + tmrs.timePassed, perc = Math.ceil(pasd * 100 / dur1); opts.auto.progress.updater.call(opts.auto.progress.bar[0], perc); }, opts.auto.progress.interval); } tmrs.auto = setTimeout(function() { if (opts.auto.progress) { opts.auto.progress.updater.call(opts.auto.progress.bar[0], 100); } if (opts.auto.onTimeoutEnd) { opts.auto.onTimeoutEnd.call($tt0, perc, dur2); } if (crsl.isScrolling) { $cfs.trigger(cf_e('play', conf), dir); } else { $cfs.trigger(cf_e(dir, conf), opts.auto); } }, dur2); // pause start callback if (opts.auto.onTimeoutStart) { opts.auto.onTimeoutStart.call($tt0, perc, dur2); } return true; }); // resume event $cfs.bind(cf_e('resume', conf), function(e) { e.stopPropagation(); if (scrl.isStopped) { scrl.isStopped = false; crsl.isPaused = false; crsl.isScrolling = true; scrl.startTime = getTime(); sc_startScroll(scrl, conf); } else { $cfs.trigger(cf_e('play', conf)); } return true; }); // prev + next events $cfs.bind(cf_e('prev', conf)+' '+cf_e('next', conf), function(e, obj, num, clb, que) { e.stopPropagation(); // stopped or hidden carousel, don't scroll, don't queue if (crsl.isStopped || $cfs.is(':hidden')) { e.stopImmediatePropagation(); return debug(conf, 'Carousel stopped or hidden: Not scrolling.'); } // not enough items var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1; if (minimum > itms.total) { e.stopImmediatePropagation(); return debug(conf, 'Not enough items ('+itms.total+' total, '+minimum+' needed): Not scrolling.'); } // get config var v = [obj, num, clb, que], t = ['object', 'number/string', 'function', 'boolean'], a = cf_sortParams(v, t); obj = a[0]; num = a[1]; clb = a[2]; que = a[3]; var eType = e.type.slice(conf.events.prefix.length); if (!is_object(obj)) { obj = {}; } if (is_function(clb)) { obj.onAfter = clb; } if (is_boolean(que)) { obj.queue = que; } obj = $.extend(true, {}, opts[eType], obj); // test conditions callback if (obj.conditions && !obj.conditions.call($tt0, eType)) { e.stopImmediatePropagation(); return debug(conf, 'Callback "conditions" returned false.'); } if (!is_number(num)) { if (opts.items.filter != '*') { num = 'visible'; } else { var arr = [num, obj.items, opts[eType].items]; for (var a = 0, l = arr.length; a < l; a++) { if (is_number(arr[a]) || arr[a] == 'page' || arr[a] == 'visible') { num = arr[a]; break; } } } switch(num) { case 'page': e.stopImmediatePropagation(); return $cfs.triggerHandler(cf_e(eType+'Page', conf), [obj, clb]); break; case 'visible': if (!opts.items.visibleConf.variable && opts.items.filter == '*') { num = opts.items.visible; } break; } } // resume animation, add current to queue if (scrl.isStopped) { $cfs.trigger(cf_e('resume', conf)); $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]); e.stopImmediatePropagation(); return debug(conf, 'Carousel resumed scrolling.'); } // queue if scrolling if (obj.duration > 0) { if (crsl.isScrolling) { if (obj.queue) { if (obj.queue == 'last') { queu = []; } if (obj.queue != 'first' || queu.length == 0) { $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]); } } e.stopImmediatePropagation(); return debug(conf, 'Carousel currently scrolling.'); } } tmrs.timePassed = 0; $cfs.trigger(cf_e('slide_'+eType, conf), [obj, num]); // synchronise if (opts.synchronise) { var s = opts.synchronise, c = [obj, num]; for (var j = 0, l = s.length; j < l; j++) { var d = eType; if (!s[j][2]) { d = (d == 'prev') ? 'next' : 'prev'; } if (!s[j][1]) { c[0] = s[j][0].triggerHandler('_cfs_triggerEvent', ['configuration', d]); } c[1] = num + s[j][3]; s[j][0].trigger('_cfs_triggerEvent', ['slide_'+d, c]); } } return true; }); // prev event $cfs.bind(cf_e('slide_prev', conf), function(e, sO, nI) { e.stopPropagation(); var a_itm = $cfs.children(); // non-circular at start, scroll to end if (!opts.circular) { if (itms.first == 0) { if (opts.infinite) { $cfs.trigger(cf_e('next', conf), itms.total-1); } return e.stopImmediatePropagation(); } } sz_resetMargin(a_itm, opts); // find number of items to scroll if (!is_number(nI)) { if (opts.items.visibleConf.variable) { nI = gn_getVisibleItemsPrev(a_itm, opts, itms.total-1); } else if (opts.items.filter != '*') { var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts); nI = gn_getScrollItemsPrevFilter(a_itm, opts, itms.total-1, xI); } else { nI = opts.items.visible; } nI = cf_getAdjust(nI, opts, sO.items, $tt0); } // prevent non-circular from scrolling to far if (!opts.circular) { if (itms.total - nI < itms.first) { nI = itms.total - itms.first; } } // set new number of visible items opts.items.visibleConf.old = opts.items.visible; if (opts.items.visibleConf.variable) { var vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0); if (opts.items.visible+nI <= vI && nI < itms.total) { nI++; vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0); } opts.items.visible = vI; } else if (opts.items.filter != '*') { var vI = gn_getVisibleItemsNextFilter(a_itm, opts, itms.total-nI); opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); } sz_resetMargin(a_itm, opts, true); // scroll 0, don't scroll if (nI == 0) { e.stopImmediatePropagation(); return debug(conf, '0 items to scroll: Not scrolling.'); } debug(conf, 'Scrolling '+nI+' items backward.'); // save new config itms.first += nI; while (itms.first >= itms.total) { itms.first -= itms.total; } // non-circular callback if (!opts.circular) { if (itms.first == 0 && sO.onEnd) { sO.onEnd.call($tt0, 'prev'); } if (!opts.infinite) { nv_enableNavi(opts, itms.first, conf); } } // rearrange items $cfs.children().slice(itms.total-nI, itms.total).prependTo($cfs); if (itms.total < opts.items.visible + nI) { $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs); } // the needed items var a_itm = $cfs.children(), i_old = gi_getOldItemsPrev(a_itm, opts, nI), i_new = gi_getNewItemsPrev(a_itm, opts), i_cur_l = a_itm.eq(nI-1), i_old_l = i_old.last(), i_new_l = i_new.last(); sz_resetMargin(a_itm, opts); var pL = 0, pR = 0; if (opts.align) { var p = cf_getAlignPadding(i_new, opts); pL = p[0]; pR = p[1]; } var oL = (pL < 0) ? opts.padding[opts.d[3]] : 0; // hide items for fx directscroll var hiddenitems = false, i_skp = $(); if (opts.items.visible < nI) { i_skp = a_itm.slice(opts.items.visibleConf.old, nI); if (sO.fx == 'directscroll') { var orgW = opts.items[opts.d['width']]; hiddenitems = i_skp; i_cur_l = i_new_l; sc_hideHiddenItems(hiddenitems); opts.items[opts.d['width']] = 'variable'; } } // save new sizes var $cf2 = false, i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding), i_siz_vis = 0, a_cfs = {}, a_wsz = {}, a_cur = {}, a_old = {}, a_new = {}, a_lef = {}, a_lef_vis = {}, a_dur = sc_getDuration(sO, opts, nI, i_siz); switch(sO.fx) { case 'cover': case 'cover-fade': i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visible), opts, 'width'); break; } if (hiddenitems) { opts.items[opts.d['width']] = orgW; } sz_resetMargin(a_itm, opts, true); if (pR >= 0) { sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]); } if (pL >= 0) { sz_resetMargin(i_cur_l, opts, opts.padding[opts.d[3]]); } if (opts.align) { opts.padding[opts.d[1]] = pR; opts.padding[opts.d[3]] = pL; } a_lef[opts.d['left']] = -(i_siz - oL); a_lef_vis[opts.d['left']] = -(i_siz_vis - oL); a_wsz[opts.d['left']] = w_siz[opts.d['width']]; // scrolling functions var _s_wrapper = function() {}, _a_wrapper = function() {}, _s_paddingold = function() {}, _a_paddingold = function() {}, _s_paddingnew = function() {}, _a_paddingnew = function() {}, _s_paddingcur = function() {}, _a_paddingcur = function() {}, _onafter = function() {}, _moveitems = function() {}, _position = function() {}; // clone carousel switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': case 'uncover': case 'uncover-fade': $cf2 = $cfs.clone(true).appendTo($wrp); break; } switch(sO.fx) { case 'crossfade': case 'uncover': case 'uncover-fade': $cf2.children().slice(0, nI).remove(); $cf2.children().slice(opts.items.visibleConf.old).remove(); break; case 'cover': case 'cover-fade': $cf2.children().slice(opts.items.visible).remove(); $cf2.css(a_lef_vis); break; } $cfs.css(a_lef); // reset all scrolls scrl = sc_setScroll(a_dur, sO.easing, conf); // animate / set carousel a_cfs[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0; // animate / set wrapper if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { _s_wrapper = function() { $wrp.css(w_siz); }; _a_wrapper = function() { scrl.anims.push([$wrp, w_siz]); }; } // animate / set items if (opts.usePadding) { if (i_new_l.not(i_cur_l).length) { a_cur[opts.d['marginRight']] = i_cur_l.data('_cfs_origCssMargin'); if (pL < 0) { i_cur_l.css(a_cur); } else { _s_paddingcur = function() { i_cur_l.css(a_cur); }; _a_paddingcur = function() { scrl.anims.push([i_cur_l, a_cur]); }; } } switch(sO.fx) { case 'cover': case 'cover-fade': $cf2.children().eq(nI-1).css(a_cur); break; } if (i_new_l.not(i_old_l).length) { a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin'); _s_paddingold = function() { i_old_l.css(a_old); }; _a_paddingold = function() { scrl.anims.push([i_old_l, a_old]); }; } if (pR >= 0) { a_new[opts.d['marginRight']] = i_new_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]; _s_paddingnew = function() { i_new_l.css(a_new); }; _a_paddingnew = function() { scrl.anims.push([i_new_l, a_new]); }; } } // set position _position = function() { $cfs.css(a_cfs); }; var overFill = opts.items.visible+nI-itms.total; // rearrange items _moveitems = function() { if (overFill > 0) { $cfs.children().slice(itms.total).remove(); i_old = $( $cfs.children().slice(itms.total-(opts.items.visible-overFill)).get().concat( $cfs.children().slice(0, overFill).get() ) ); } sc_showHiddenItems(hiddenitems); if (opts.usePadding) { var l_itm = $cfs.children().eq(opts.items.visible+nI-1); l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin')); } }; var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'prev', a_dur, w_siz); // fire onAfter callbacks _onafter = function() { sc_afterScroll($cfs, $cf2, sO); crsl.isScrolling = false; clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk); queu = sc_fireQueue($cfs, queu, conf); if (!crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } }; // fire onBefore callback crsl.isScrolling = true; tmrs = sc_clearTimers(tmrs); clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk); switch(sO.fx) { case 'none': $cfs.css(a_cfs); _s_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); break; case 'fade': scrl.anims.push([$cfs, { 'opacity': 0 }, function() { _s_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); scrl = sc_setScroll(a_dur, sO.easing, conf); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); sc_startScroll(scrl, conf); }]); break; case 'crossfade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; case 'cover': scrl.anims.push([$cf2, a_cfs, function() { _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); }]); _a_wrapper(); break; case 'cover-fade': scrl.anims.push([$cfs, { 'opacity': 0 }]); scrl.anims.push([$cf2, a_cfs, function() { _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); }]); _a_wrapper(); break; case 'uncover': scrl.anims.push([$cf2, a_wsz, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; case 'uncover-fade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cfs, { 'opacity': 1 }]); scrl.anims.push([$cf2, a_wsz, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; default: scrl.anims.push([$cfs, a_cfs, function() { _moveitems(); _onafter(); }]); _a_wrapper(); _a_paddingold(); _a_paddingnew(); _a_paddingcur(); break; } sc_startScroll(scrl, conf); cf_setCookie(opts.cookie, $cfs, conf); $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]); return true; }); // next event $cfs.bind(cf_e('slide_next', conf), function(e, sO, nI) { e.stopPropagation(); var a_itm = $cfs.children(); // non-circular at end, scroll to start if (!opts.circular) { if (itms.first == opts.items.visible) { if (opts.infinite) { $cfs.trigger(cf_e('prev', conf), itms.total-1); } return e.stopImmediatePropagation(); } } sz_resetMargin(a_itm, opts); // find number of items to scroll if (!is_number(nI)) { if (opts.items.filter != '*') { var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts); nI = gn_getScrollItemsNextFilter(a_itm, opts, 0, xI); } else { nI = opts.items.visible; } nI = cf_getAdjust(nI, opts, sO.items, $tt0); } var lastItemNr = (itms.first == 0) ? itms.total : itms.first; // prevent non-circular from scrolling to far if (!opts.circular) { if (opts.items.visibleConf.variable) { var vI = gn_getVisibleItemsNext(a_itm, opts, nI), xI = gn_getVisibleItemsPrev(a_itm, opts, lastItemNr-1); } else { var vI = opts.items.visible, xI = opts.items.visible; } if (nI + vI > lastItemNr) { nI = lastItemNr - xI; } } // set new number of visible items opts.items.visibleConf.old = opts.items.visible; if (opts.items.visibleConf.variable) { var vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0); while (opts.items.visible-nI >= vI && nI < itms.total) { nI++; vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0); } opts.items.visible = vI; } else if (opts.items.filter != '*') { var vI = gn_getVisibleItemsNextFilter(a_itm, opts, nI); opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); } sz_resetMargin(a_itm, opts, true); // scroll 0, don't scroll if (nI == 0) { e.stopImmediatePropagation(); return debug(conf, '0 items to scroll: Not scrolling.'); } debug(conf, 'Scrolling '+nI+' items forward.'); // save new config itms.first -= nI; while (itms.first < 0) { itms.first += itms.total; } // non-circular callback if (!opts.circular) { if (itms.first == opts.items.visible && sO.onEnd) { sO.onEnd.call($tt0, 'next'); } if (!opts.infinite) { nv_enableNavi(opts, itms.first, conf); } } // rearrange items if (itms.total < opts.items.visible+nI) { $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs); } // the needed items var a_itm = $cfs.children(), i_old = gi_getOldItemsNext(a_itm, opts), i_new = gi_getNewItemsNext(a_itm, opts, nI), i_cur_l = a_itm.eq(nI-1), i_old_l = i_old.last(), i_new_l = i_new.last(); sz_resetMargin(a_itm, opts); var pL = 0, pR = 0; if (opts.align) { var p = cf_getAlignPadding(i_new, opts); pL = p[0]; pR = p[1]; } // hide items for fx directscroll var hiddenitems = false, i_skp = $(); if (opts.items.visibleConf.old < nI) { i_skp = a_itm.slice(opts.items.visibleConf.old, nI); if (sO.fx == 'directscroll') { var orgW = opts.items[opts.d['width']]; hiddenitems = i_skp; i_cur_l = i_old_l; sc_hideHiddenItems(hiddenitems); opts.items[opts.d['width']] = 'variable'; } } // save new sizes var $cf2 = false, i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding), i_siz_vis = 0, a_cfs = {}, a_cfs_vis = {}, a_cur = {}, a_old = {}, a_lef = {}, a_dur = sc_getDuration(sO, opts, nI, i_siz); switch(sO.fx) { case 'uncover': case 'uncover-fade': i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visibleConf.old), opts, 'width'); break; } if (hiddenitems) { opts.items[opts.d['width']] = orgW; } if (opts.align) { if (opts.padding[opts.d[1]] < 0) { opts.padding[opts.d[1]] = 0; } } sz_resetMargin(a_itm, opts, true); sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]); if (opts.align) { opts.padding[opts.d[1]] = pR; opts.padding[opts.d[3]] = pL; } a_lef[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0; // scrolling functions var _s_wrapper = function() {}, _a_wrapper = function() {}, _s_paddingold = function() {}, _a_paddingold = function() {}, _s_paddingcur = function() {}, _a_paddingcur = function() {}, _onafter = function() {}, _moveitems = function() {}, _position = function() {}; // clone carousel switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': case 'uncover': case 'uncover-fade': $cf2 = $cfs.clone(true).appendTo($wrp); $cf2.children().slice(opts.items.visibleConf.old).remove(); break; } switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': $cfs.css('zIndex', 1); $cf2.css('zIndex', 0); break; } // reset all scrolls scrl = sc_setScroll(a_dur, sO.easing, conf); // animate / set carousel a_cfs[opts.d['left']] = -i_siz; a_cfs_vis[opts.d['left']] = -i_siz_vis; if (pL < 0) { a_cfs[opts.d['left']] += pL; } // animate / set wrapper if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { _s_wrapper = function() { $wrp.css(w_siz); }; _a_wrapper = function() { scrl.anims.push([$wrp, w_siz]); }; } // animate / set items if (opts.usePadding) { var i_new_l_m = i_new_l.data('_cfs_origCssMargin'); if (pR >= 0) { i_new_l_m += opts.padding[opts.d[1]]; } i_new_l.css(opts.d['marginRight'], i_new_l_m); if (i_cur_l.not(i_old_l).length) { a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin'); } _s_paddingold = function() { i_old_l.css(a_old); }; _a_paddingold = function() { scrl.anims.push([i_old_l, a_old]); }; var i_cur_l_m = i_cur_l.data('_cfs_origCssMargin'); if (pL > 0) { i_cur_l_m += opts.padding[opts.d[3]]; } a_cur[opts.d['marginRight']] = i_cur_l_m; _s_paddingcur = function() { i_cur_l.css(a_cur); }; _a_paddingcur = function() { scrl.anims.push([i_cur_l, a_cur]); }; } // set position _position = function() { $cfs.css(a_lef); }; var overFill = opts.items.visible+nI-itms.total; // rearrange items _moveitems = function() { if (overFill > 0) { $cfs.children().slice(itms.total).remove(); } var l_itm = $cfs.children().slice(0, nI).appendTo($cfs).last(); if (overFill > 0) { i_new = gi_getCurrentItems(a_itm, opts); } sc_showHiddenItems(hiddenitems); if (opts.usePadding) { if (itms.total < opts.items.visible+nI) { var i_cur_l = $cfs.children().eq(opts.items.visible-1); i_cur_l.css(opts.d['marginRight'], i_cur_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]); } l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin')); } }; var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'next', a_dur, w_siz); // fire onAfter callbacks _onafter = function() { $cfs.css('zIndex', $cfs.data('_cfs_origCssZindex')); sc_afterScroll($cfs, $cf2, sO); crsl.isScrolling = false; clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk); queu = sc_fireQueue($cfs, queu, conf); if (!crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } }; // fire onBefore callbacks crsl.isScrolling = true; tmrs = sc_clearTimers(tmrs); clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk); switch(sO.fx) { case 'none': $cfs.css(a_cfs); _s_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); _onafter(); break; case 'fade': scrl.anims.push([$cfs, { 'opacity': 0 }, function() { _s_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); scrl = sc_setScroll(a_dur, sO.easing, conf); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); sc_startScroll(scrl, conf); }]); break; case 'crossfade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; case 'cover': $cfs.css(opts.d['left'], $wrp[opts.d['width']]()); scrl.anims.push([$cfs, a_lef, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _moveitems(); break; case 'cover-fade': $cfs.css(opts.d['left'], $wrp[opts.d['width']]()); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, a_lef, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _moveitems(); break; case 'uncover': scrl.anims.push([$cf2, a_cfs_vis, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; case 'uncover-fade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cfs, { 'opacity': 1 }]); scrl.anims.push([$cf2, a_cfs_vis, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; default: scrl.anims.push([$cfs, a_cfs, function() { _position(); _moveitems(); _onafter(); }]); _a_wrapper(); _a_paddingold(); _a_paddingcur(); break; } sc_startScroll(scrl, conf); cf_setCookie(opts.cookie, $cfs, conf); $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]); return true; }); // slideTo event $cfs.bind(cf_e('slideTo', conf), function(e, num, dev, org, obj, dir, clb) { e.stopPropagation(); var v = [num, dev, org, obj, dir, clb], t = ['string/number/object', 'number', 'boolean', 'object', 'string', 'function'], a = cf_sortParams(v, t); obj = a[3]; dir = a[4]; clb = a[5]; num = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs); if (num == 0) { return false; } if (!is_object(obj)) { obj = false; } if (dir != 'prev' && dir != 'next') { if (opts.circular) { dir = (num <= itms.total / 2) ? 'next' : 'prev'; } else { dir = (itms.first == 0 || itms.first > num) ? 'next' : 'prev'; } } if (dir == 'prev') { num = itms.total-num; } $cfs.trigger(cf_e(dir, conf), [obj, num, clb]); return true; }); // prevPage event $cfs.bind(cf_e('prevPage', conf), function(e, obj, clb) { e.stopPropagation(); var cur = $cfs.triggerHandler(cf_e('currentPage', conf)); return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur-1, obj, 'prev', clb]); }); // nextPage event $cfs.bind(cf_e('nextPage', conf), function(e, obj, clb) { e.stopPropagation(); var cur = $cfs.triggerHandler(cf_e('currentPage', conf)); return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur+1, obj, 'next', clb]); }); // slideToPage event $cfs.bind(cf_e('slideToPage', conf), function(e, pag, obj, dir, clb) { e.stopPropagation(); if (!is_number(pag)) { pag = $cfs.triggerHandler(cf_e('currentPage', conf)); } var ipp = opts.pagination.items || opts.items.visible, max = Math.ceil(itms.total / ipp)-1; if (pag < 0) { pag = max; } if (pag > max) { pag = 0; } return $cfs.triggerHandler(cf_e('slideTo', conf), [pag*ipp, 0, true, obj, dir, clb]); }); // jumpToStart event $cfs.bind(cf_e('jumpToStart', conf), function(e, s) { e.stopPropagation(); if (s) { s = gn_getItemIndex(s, 0, true, itms, $cfs); } else { s = 0; } s += itms.first; if (s != 0) { if (itms.total > 0) { while (s > itms.total) { s -= itms.total; } } $cfs.prepend($cfs.children().slice(s, itms.total)); } return true; }); // synchronise event $cfs.bind(cf_e('synchronise', conf), function(e, s) { e.stopPropagation(); if (s) { s = cf_getSynchArr(s); } else if (opts.synchronise) { s = opts.synchronise; } else { return debug(conf, 'No carousel to synchronise.'); } var n = $cfs.triggerHandler(cf_e('currentPosition', conf)), x = true; for (var j = 0, l = s.length; j < l; j++) { if (!s[j][0].triggerHandler(cf_e('slideTo', conf), [n, s[j][3], true])) { x = false; } } return x; }); // queue event $cfs.bind(cf_e('queue', conf), function(e, dir, opt) { e.stopPropagation(); if (is_function(dir)) { dir.call($tt0, queu); } else if (is_array(dir)) { queu = dir; } else if (!is_undefined(dir)) { queu.push([dir, opt]); } return queu; }); // insertItem event $cfs.bind(cf_e('insertItem', conf), function(e, itm, num, org, dev) { e.stopPropagation(); var v = [itm, num, org, dev], t = ['string/object', 'string/number/object', 'boolean', 'number'], a = cf_sortParams(v, t); itm = a[0]; num = a[1]; org = a[2]; dev = a[3]; if (is_object(itm) && !is_jquery(itm)) { itm = $(itm); } else if (is_string(itm)) { itm = $(itm); } if (!is_jquery(itm) || itm.length == 0) { return debug(conf, 'Not a valid object.'); } if (is_undefined(num)) { num = 'end'; } sz_storeMargin(itm, opts); sz_storeOrigCss(itm); var orgNum = num, before = 'before'; if (num == 'end') { if (org) { if (itms.first == 0) { num = itms.total-1; before = 'after'; } else { num = itms.first; itms.first += itm.length; } if (num < 0) { num = 0; } } else { num = itms.total-1; before = 'after'; } } else { num = gn_getItemIndex(num, dev, org, itms, $cfs); } var $cit = $cfs.children().eq(num); if ($cit.length) { $cit[before](itm); } else { debug(conf, 'Correct insert-position not found! Appending item to the end.'); $cfs.append(itm); } if (orgNum != 'end' && !org) { if (num < itms.first) { itms.first += itm.length; } } itms.total = $cfs.children().length; if (itms.first >= itms.total) { itms.first -= itms.total; } $cfs.trigger(cf_e('updateSizes', conf)); $cfs.trigger(cf_e('linkAnchors', conf)); return true; }); // removeItem event $cfs.bind(cf_e('removeItem', conf), function(e, num, org, dev) { e.stopPropagation(); var v = [num, org, dev], t = ['string/number/object', 'boolean', 'number'], a = cf_sortParams(v, t); num = a[0]; org = a[1]; dev = a[2]; var removed = false; if (num instanceof $ && num.length > 1) { $removed = $(); num.each(function(i, el) { var $rem = $cfs.trigger(cf_e('removeItem', conf), [$(this), org, dev]); if ( $rem ) { $removed = $removed.add($rem); } }); return $removed; } if (is_undefined(num) || num == 'end') { $removed = $cfs.children().last(); } else { num = gn_getItemIndex(num, dev, org, itms, $cfs); var $removed = $cfs.children().eq(num); if ( $removed.length ) { if (num < itms.first) { itms.first -= $removed.length; } } } if ( $removed && $removed.length ) { $removed.detach(); itms.total = $cfs.children().length; $cfs.trigger(cf_e('updateSizes', conf)); } return $removed; }); // onBefore and onAfter event $cfs.bind(cf_e('onBefore', conf)+' '+cf_e('onAfter', conf), function(e, fn) { e.stopPropagation(); var eType = e.type.slice(conf.events.prefix.length); if (is_array(fn)) { clbk[eType] = fn; } if (is_function(fn)) { clbk[eType].push(fn); } return clbk[eType]; }); // currentPosition event $cfs.bind(cf_e('currentPosition', conf), function(e, fn) { e.stopPropagation(); if (itms.first == 0) { var val = 0; } else { var val = itms.total - itms.first; } if (is_function(fn)) { fn.call($tt0, val); } return val; }); // currentPage event $cfs.bind(cf_e('currentPage', conf), function(e, fn) { e.stopPropagation(); var ipp = opts.pagination.items || opts.items.visible, max = Math.ceil(itms.total/ipp-1), nr; if (itms.first == 0) { nr = 0; } else if (itms.first < itms.total % ipp) { nr = 0; } else if (itms.first == ipp && !opts.circular) { nr = max; } else { nr = Math.round((itms.total-itms.first)/ipp); } if (nr < 0) { nr = 0; } if (nr > max) { nr = max; } if (is_function(fn)) { fn.call($tt0, nr); } return nr; }); // currentVisible event $cfs.bind(cf_e('currentVisible', conf), function(e, fn) { e.stopPropagation(); var $i = gi_getCurrentItems($cfs.children(), opts); if (is_function(fn)) { fn.call($tt0, $i); } return $i; }); // slice event $cfs.bind(cf_e('slice', conf), function(e, f, l, fn) { e.stopPropagation(); if (itms.total == 0) { return false; } var v = [f, l, fn], t = ['number', 'number', 'function'], a = cf_sortParams(v, t); f = (is_number(a[0])) ? a[0] : 0; l = (is_number(a[1])) ? a[1] : itms.total; fn = a[2]; f += itms.first; l += itms.first; if (items.total > 0) { while (f > itms.total) { f -= itms.total; } while (l > itms.total) { l -= itms.total; } while (f < 0) { f += itms.total; } while (l < 0) { l += itms.total; } } var $iA = $cfs.children(), $i; if (l > f) { $i = $iA.slice(f, l); } else { $i = $( $iA.slice(f, itms.total).get().concat( $iA.slice(0, l).get() ) ); } if (is_function(fn)) { fn.call($tt0, $i); } return $i; }); // isPaused, isStopped and isScrolling events $cfs.bind(cf_e('isPaused', conf)+' '+cf_e('isStopped', conf)+' '+cf_e('isScrolling', conf), function(e, fn) { e.stopPropagation(); var eType = e.type.slice(conf.events.prefix.length), value = crsl[eType]; if (is_function(fn)) { fn.call($tt0, value); } return value; }); // configuration event $cfs.bind(cf_e('configuration', conf), function(e, a, b, c) { e.stopPropagation(); var reInit = false; // return entire configuration-object if (is_function(a)) { a.call($tt0, opts); } // set multiple options via object else if (is_object(a)) { opts_orig = $.extend(true, {}, opts_orig, a); if (b !== false) reInit = true; else opts = $.extend(true, {}, opts, a); } else if (!is_undefined(a)) { // callback function for specific option if (is_function(b)) { var val = eval('opts.'+a); if (is_undefined(val)) { val = ''; } b.call($tt0, val); } // set individual option else if (!is_undefined(b)) { if (typeof c !== 'boolean') c = true; eval('opts_orig.'+a+' = b'); if (c !== false) reInit = true; else eval('opts.'+a+' = b'); } // return value for specific option else { return eval('opts.'+a); } } if (reInit) { sz_resetMargin($cfs.children(), opts); FN._init(opts_orig); FN._bind_buttons(); var sz = sz_setSizes($cfs, opts); $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]); } return opts; }); // linkAnchors event $cfs.bind(cf_e('linkAnchors', conf), function(e, $con, sel) { e.stopPropagation(); if (is_undefined($con)) { $con = $('body'); } else if (is_string($con)) { $con = $($con); } if (!is_jquery($con) || $con.length == 0) { return debug(conf, 'Not a valid object.'); } if (!is_string(sel)) { sel = 'a.caroufredsel'; } $con.find(sel).each(function() { var h = this.hash || ''; if (h.length > 0 && $cfs.children().index($(h)) != -1) { $(this).unbind('click').click(function(e) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), h); }); } }); return true; }); // updatePageStatus event $cfs.bind(cf_e('updatePageStatus', conf), function(e, build, sizes) { e.stopPropagation(); if (!opts.pagination.container) { return; } var ipp = opts.pagination.items || opts.items.visible, pgs = Math.ceil(itms.total/ipp); if (build) { if (opts.pagination.anchorBuilder) { opts.pagination.container.children().remove(); opts.pagination.container.each(function() { for (var a = 0; a < pgs; a++) { var i = $cfs.children().eq( gn_getItemIndex(a*ipp, 0, true, itms, $cfs) ); $(this).append(opts.pagination.anchorBuilder.call(i[0], a+1)); } }); } opts.pagination.container.each(function() { $(this).children().unbind(opts.pagination.event).each(function(a) { $(this).bind(opts.pagination.event, function(e) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), [a*ipp, -opts.pagination.deviation, true, opts.pagination]); }); }); }); } var selected = $cfs.triggerHandler(cf_e('currentPage', conf)) + opts.pagination.deviation; if (selected >= pgs) { selected = 0; } if (selected < 0) { selected = pgs-1; } opts.pagination.container.each(function() { $(this).children().removeClass(cf_c('selected', conf)).eq(selected).addClass(cf_c('selected', conf)); }); return true; }); // updateSizes event $cfs.bind(cf_e('updateSizes', conf), function(e) { var vI = opts.items.visible, a_itm = $cfs.children(), avail_primary = ms_getParentSize($wrp, opts, 'width'); itms.total = a_itm.length; if (crsl.primarySizePercentage) { opts.maxDimension = avail_primary; opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage); } else { opts.maxDimension = ms_getMaxDimension(opts, avail_primary); } if (opts.responsive) { opts.items.width = opts.items.sizesConf.width; opts.items.height = opts.items.sizesConf.height; opts = in_getResponsiveValues(opts, a_itm, avail_primary); vI = opts.items.visible; sz_setResponsiveSizes(opts, a_itm); } else if (opts.items.visibleConf.variable) { vI = gn_getVisibleItemsNext(a_itm, opts, 0); } else if (opts.items.filter != '*') { vI = gn_getVisibleItemsNextFilter(a_itm, opts, 0); } if (!opts.circular && itms.first != 0 && vI > itms.first) { if (opts.items.visibleConf.variable) { var nI = gn_getVisibleItemsPrev(a_itm, opts, itms.first) - itms.first; } else if (opts.items.filter != '*') { var nI = gn_getVisibleItemsPrevFilter(a_itm, opts, itms.first) - itms.first; } else { var nI = opts.items.visible - itms.first; } debug(conf, 'Preventing non-circular: sliding '+nI+' items backward.'); $cfs.trigger(cf_e('prev', conf), nI); } opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); opts.items.visibleConf.old = opts.items.visible; opts = in_getAlignPadding(opts, a_itm); var sz = sz_setSizes($cfs, opts); $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]); nv_showNavi(opts, itms.total, conf); nv_enableNavi(opts, itms.first, conf); return sz; }); // destroy event $cfs.bind(cf_e('destroy', conf), function(e, orgOrder) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); $cfs.data('_cfs_isCarousel', false); $cfs.trigger(cf_e('finish', conf)); if (orgOrder) { $cfs.trigger(cf_e('jumpToStart', conf)); } sz_restoreOrigCss($cfs.children()); sz_restoreOrigCss($cfs); FN._unbind_events(); FN._unbind_buttons(); if (conf.wrapper == 'parent') { sz_restoreOrigCss($wrp); } else { $wrp.replaceWith($cfs); } return true; }); // debug event $cfs.bind(cf_e('debug', conf), function(e) { debug(conf, 'Carousel width: ' + opts.width); debug(conf, 'Carousel height: ' + opts.height); debug(conf, 'Item widths: ' + opts.items.width); debug(conf, 'Item heights: ' + opts.items.height); debug(conf, 'Number of items visible: ' + opts.items.visible); if (opts.auto.play) { debug(conf, 'Number of items scrolled automatically: ' + opts.auto.items); } if (opts.prev.button) { debug(conf, 'Number of items scrolled backward: ' + opts.prev.items); } if (opts.next.button) { debug(conf, 'Number of items scrolled forward: ' + opts.next.items); } return conf.debug; }); // triggerEvent, making prefixed and namespaced events accessible from outside $cfs.bind('_cfs_triggerEvent', function(e, n, o) { e.stopPropagation(); return $cfs.triggerHandler(cf_e(n, conf), o); }); }; // /bind_events FN._unbind_events = function() { $cfs.unbind(cf_e('', conf)); $cfs.unbind(cf_e('', conf, false)); $cfs.unbind('_cfs_triggerEvent'); }; // /unbind_events FN._bind_buttons = function() { FN._unbind_buttons(); nv_showNavi(opts, itms.total, conf); nv_enableNavi(opts, itms.first, conf); if (opts.auto.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.auto.pauseOnHover); $wrp.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } // play button if (opts.auto.button) { opts.auto.button.bind(cf_e(opts.auto.event, conf, false), function(e) { e.preventDefault(); var ev = false, pC = null; if (crsl.isPaused) { ev = 'play'; } else if (opts.auto.pauseOnEvent) { ev = 'pause'; pC = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent); } if (ev) { $cfs.trigger(cf_e(ev, conf), pC); } }); } // prev button if (opts.prev.button) { opts.prev.button.bind(cf_e(opts.prev.event, conf, false), function(e) { e.preventDefault(); $cfs.trigger(cf_e('prev', conf)); }); if (opts.prev.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.prev.pauseOnHover); opts.prev.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // next butotn if (opts.next.button) { opts.next.button.bind(cf_e(opts.next.event, conf, false), function(e) { e.preventDefault(); $cfs.trigger(cf_e('next', conf)); }); if (opts.next.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.next.pauseOnHover); opts.next.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // pagination if (opts.pagination.container) { if (opts.pagination.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover); opts.pagination.container.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // prev/next keys if (opts.prev.key || opts.next.key) { $(document).bind(cf_e('keyup', conf, false, true, true), function(e) { var k = e.keyCode; if (k == opts.next.key) { e.preventDefault(); $cfs.trigger(cf_e('next', conf)); } if (k == opts.prev.key) { e.preventDefault(); $cfs.trigger(cf_e('prev', conf)); } }); } // pagination keys if (opts.pagination.keys) { $(document).bind(cf_e('keyup', conf, false, true, true), function(e) { var k = e.keyCode; if (k >= 49 && k < 58) { k = (k-49) * opts.items.visible; if (k <= itms.total) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), [k, 0, true, opts.pagination]); } } }); } // swipe if ($.fn.swipe) { var isTouch = 'ontouchstart' in window; if ((isTouch && opts.swipe.onTouch) || (!isTouch && opts.swipe.onMouse)) { var scP = $.extend(true, {}, opts.prev, opts.swipe), scN = $.extend(true, {}, opts.next, opts.swipe), swP = function() { $cfs.trigger(cf_e('prev', conf), [scP]) }, swN = function() { $cfs.trigger(cf_e('next', conf), [scN]) }; switch (opts.direction) { case 'up': case 'down': opts.swipe.options.swipeUp = swN; opts.swipe.options.swipeDown = swP; break; default: opts.swipe.options.swipeLeft = swN; opts.swipe.options.swipeRight = swP; } if (crsl.swipe) { $cfs.swipe('destroy'); } $wrp.swipe(opts.swipe.options); $wrp.css('cursor', 'move'); crsl.swipe = true; } } // mousewheel if ($.fn.mousewheel) { if (opts.mousewheel) { var mcP = $.extend(true, {}, opts.prev, opts.mousewheel), mcN = $.extend(true, {}, opts.next, opts.mousewheel); if (crsl.mousewheel) { $wrp.unbind(cf_e('mousewheel', conf, false)); } $wrp.bind(cf_e('mousewheel', conf, false), function(e, delta) { e.preventDefault(); if (delta > 0) { $cfs.trigger(cf_e('prev', conf), [mcP]); } else { $cfs.trigger(cf_e('next', conf), [mcN]); } }); crsl.mousewheel = true; } } if (opts.auto.play) { $cfs.trigger(cf_e('play', conf), opts.auto.delay); } if (crsl.upDateOnWindowResize) { var resizeFn = function(e) { $cfs.trigger(cf_e('finish', conf)); if (opts.auto.pauseOnResize && !crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } sz_resetMargin($cfs.children(), opts); $cfs.trigger(cf_e('updateSizes', conf)); }; var $w = $(window), onResize = null; if ($.debounce && conf.onWindowResize == 'debounce') { onResize = $.debounce(200, resizeFn); } else if ($.throttle && conf.onWindowResize == 'throttle') { onResize = $.throttle(300, resizeFn); } else { var _windowWidth = 0, _windowHeight = 0; onResize = function() { var nw = $w.width(), nh = $w.height(); if (nw != _windowWidth || nh != _windowHeight) { resizeFn(); _windowWidth = nw; _windowHeight = nh; } }; } $w.bind(cf_e('resize', conf, false, true, true), onResize); } }; // /bind_buttons FN._unbind_buttons = function() { var ns1 = cf_e('', conf), ns2 = cf_e('', conf, false); ns3 = cf_e('', conf, false, true, true); $(document).unbind(ns3); $(window).unbind(ns3); $wrp.unbind(ns2); if (opts.auto.button) { opts.auto.button.unbind(ns2); } if (opts.prev.button) { opts.prev.button.unbind(ns2); } if (opts.next.button) { opts.next.button.unbind(ns2); } if (opts.pagination.container) { opts.pagination.container.unbind(ns2); if (opts.pagination.anchorBuilder) { opts.pagination.container.children().remove(); } } if (crsl.swipe) { $cfs.swipe('destroy'); $wrp.css('cursor', 'default'); crsl.swipe = false; } if (crsl.mousewheel) { crsl.mousewheel = false; } nv_showNavi(opts, 'hide', conf); nv_enableNavi(opts, 'removeClass', conf); }; // /unbind_buttons // START if (is_boolean(configs)) { configs = { 'debug': configs }; } // set vars var crsl = { 'direction' : 'next', 'isPaused' : true, 'isScrolling' : false, 'isStopped' : false, 'mousewheel' : false, 'swipe' : false }, itms = { 'total' : $cfs.children().length, 'first' : 0 }, tmrs = { 'auto' : null, 'progress' : null, 'startTime' : getTime(), 'timePassed' : 0 }, scrl = { 'isStopped' : false, 'duration' : 0, 'startTime' : 0, 'easing' : '', 'anims' : [] }, clbk = { 'onBefore' : [], 'onAfter' : [] }, queu = [], conf = $.extend(true, {}, $.fn.carouFredSel.configs, configs), opts = {}, opts_orig = $.extend(true, {}, options), $wrp = (conf.wrapper == 'parent') ? $cfs.parent() : $cfs.wrap('<'+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent(); conf.selector = $cfs.selector; conf.serialNumber = $.fn.carouFredSel.serialNumber++; conf.transition = (conf.transition && $.fn.transition) ? 'transition' : 'animate'; // create carousel FN._init(opts_orig, true, starting_position); FN._build(); FN._bind_events(); FN._bind_buttons(); // find item to start if (is_array(opts.items.start)) { var start_arr = opts.items.start; } else { var start_arr = []; if (opts.items.start != 0) { start_arr.push(opts.items.start); } } if (opts.cookie) { start_arr.unshift(parseInt(cf_getCookie(opts.cookie), 10)); } if (start_arr.length > 0) { for (var a = 0, l = start_arr.length; a < l; a++) { var s = start_arr[a]; if (s == 0) { continue; } if (s === true) { s = window.location.hash; if (s.length < 1) { continue; } } else if (s === 'random') { s = Math.floor(Math.random()*itms.total); } if ($cfs.triggerHandler(cf_e('slideTo', conf), [s, 0, true, { fx: 'none' }])) { break; } } } var siz = sz_setSizes($cfs, opts), itm = gi_getCurrentItems($cfs.children(), opts); if (opts.onCreate) { opts.onCreate.call($tt0, { 'width': siz.width, 'height': siz.height, 'items': itm }); } $cfs.trigger(cf_e('updatePageStatus', conf), [true, siz]); $cfs.trigger(cf_e('linkAnchors', conf)); if (conf.debug) { $cfs.trigger(cf_e('debug', conf)); } return $cfs; }; // GLOBAL PUBLIC $.fn.carouFredSel.serialNumber = 1; $.fn.carouFredSel.defaults = { 'synchronise' : false, 'infinite' : true, 'circular' : true, 'responsive' : false, 'direction' : 'left', 'items' : { 'start' : 0 }, 'scroll' : { 'easing' : 'swing', 'duration' : 500, 'pauseOnHover' : false, 'event' : 'click', 'queue' : false } }; $.fn.carouFredSel.configs = { 'debug' : false, 'transition' : false, 'onWindowResize': 'throttle', 'events' : { 'prefix' : '', 'namespace' : 'cfs' }, 'wrapper' : { 'element' : 'div', 'classname' : 'caroufredsel_wrapper' }, 'classnames' : {} }; $.fn.carouFredSel.pageAnchorBuilder = function(nr) { return ''+nr+''; }; $.fn.carouFredSel.progressbarUpdater = function(perc) { $(this).css('width', perc+'%'); }; $.fn.carouFredSel.cookie = { get: function(n) { n += '='; var ca = document.cookie.split(';'); for (var a = 0, l = ca.length; a < l; a++) { var c = ca[a]; while (c.charAt(0) == ' ') { c = c.slice(1); } if (c.indexOf(n) == 0) { return c.slice(n.length); } } return 0; }, set: function(n, v, d) { var e = ""; if (d) { var date = new Date(); date.setTime(date.getTime() + (d * 24 * 60 * 60 * 1000)); e = "; expires=" + date.toGMTString(); } document.cookie = n + '=' + v + e + '; path=/'; }, remove: function(n) { $.fn.carouFredSel.cookie.set(n, "", -1); } }; // GLOBAL PRIVATE // scrolling functions function sc_setScroll(d, e, c) { if (c.transition == 'transition') { if (e == 'swing') { e = 'ease'; } } return { anims: [], duration: d, orgDuration: d, easing: e, startTime: getTime() }; } function sc_startScroll(s, c) { for (var a = 0, l = s.anims.length; a < l; a++) { var b = s.anims[a]; if (!b) { continue; } b[0][c.transition](b[1], s.duration, s.easing, b[2]); } } function sc_stopScroll(s, finish) { if (!is_boolean(finish)) { finish = true; } if (is_object(s.pre)) { sc_stopScroll(s.pre, finish); } for (var a = 0, l = s.anims.length; a < l; a++) { var b = s.anims[a]; b[0].stop(true); if (finish) { b[0].css(b[1]); if (is_function(b[2])) { b[2](); } } } if (is_object(s.post)) { sc_stopScroll(s.post, finish); } } function sc_afterScroll( $c, $c2, o ) { if ($c2) { $c2.remove(); } switch(o.fx) { case 'fade': case 'crossfade': case 'cover-fade': case 'uncover-fade': $c.css('opacity', 1); $c.css('filter', ''); break; } } function sc_fireCallbacks($t, o, b, a, c) { if (o[b]) { o[b].call($t, a); } if (c[b].length) { for (var i = 0, l = c[b].length; i < l; i++) { c[b][i].call($t, a); } } return []; } function sc_fireQueue($c, q, c) { if (q.length) { $c.trigger(cf_e(q[0][0], c), q[0][1]); q.shift(); } return q; } function sc_hideHiddenItems(hiddenitems) { hiddenitems.each(function() { var hi = $(this); hi.data('_cfs_isHidden', hi.is(':hidden')).hide(); }); } function sc_showHiddenItems(hiddenitems) { if (hiddenitems) { hiddenitems.each(function() { var hi = $(this); if (!hi.data('_cfs_isHidden')) { hi.show(); } }); } } function sc_clearTimers(t) { if (t.auto) { clearTimeout(t.auto); } if (t.progress) { clearInterval(t.progress); } return t; } function sc_mapCallbackArguments(i_old, i_skp, i_new, s_itm, s_dir, s_dur, w_siz) { return { 'width': w_siz.width, 'height': w_siz.height, 'items': { 'old': i_old, 'skipped': i_skp, 'visible': i_new }, 'scroll': { 'items': s_itm, 'direction': s_dir, 'duration': s_dur } }; } function sc_getDuration( sO, o, nI, siz ) { var dur = sO.duration; if (sO.fx == 'none') { return 0; } if (dur == 'auto') { dur = o.scroll.duration / o.scroll.items * nI; } else if (dur < 10) { dur = siz / dur; } if (dur < 1) { return 0; } if (sO.fx == 'fade') { dur = dur / 2; } return Math.round(dur); } // navigation functions function nv_showNavi(o, t, c) { var minimum = (is_number(o.items.minimum)) ? o.items.minimum : o.items.visible + 1; if (t == 'show' || t == 'hide') { var f = t; } else if (minimum > t) { debug(c, 'Not enough items ('+t+' total, '+minimum+' needed): Hiding navigation.'); var f = 'hide'; } else { var f = 'show'; } var s = (f == 'show') ? 'removeClass' : 'addClass', h = cf_c('hidden', c); if (o.auto.button) { o.auto.button[f]()[s](h); } if (o.prev.button) { o.prev.button[f]()[s](h); } if (o.next.button) { o.next.button[f]()[s](h); } if (o.pagination.container) { o.pagination.container[f]()[s](h); } } function nv_enableNavi(o, f, c) { if (o.circular || o.infinite) return; var fx = (f == 'removeClass' || f == 'addClass') ? f : false, di = cf_c('disabled', c); if (o.auto.button && fx) { o.auto.button[fx](di); } if (o.prev.button) { var fn = fx || (f == 0) ? 'addClass' : 'removeClass'; o.prev.button[fn](di); } if (o.next.button) { var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass'; o.next.button[fn](di); } } // get object functions function go_getObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } else if (is_undefined(obj)) { obj = {}; } return obj; } function go_getItemsObject($tt, obj) { obj = go_getObject($tt, obj); if (is_number(obj)) { obj = { 'visible': obj }; } else if (obj == 'variable') { obj = { 'visible': obj, 'width': obj, 'height': obj }; } else if (!is_object(obj)) { obj = {}; } return obj; } function go_getScrollObject($tt, obj) { obj = go_getObject($tt, obj); if (is_number(obj)) { if (obj <= 50) { obj = { 'items': obj }; } else { obj = { 'duration': obj }; } } else if (is_string(obj)) { obj = { 'easing': obj }; } else if (!is_object(obj)) { obj = {}; } return obj; } function go_getNaviObject($tt, obj) { obj = go_getObject($tt, obj); if (is_string(obj)) { var temp = cf_getKeyCode(obj); if (temp == -1) { obj = $(obj); } else { obj = temp; } } return obj; } function go_getAutoObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'button': obj }; } else if (is_boolean(obj)) { obj = { 'play': obj }; } else if (is_number(obj)) { obj = { 'timeoutDuration': obj }; } if (obj.progress) { if (is_string(obj.progress) || is_jquery(obj.progress)) { obj.progress = { 'bar': obj.progress }; } } return obj; } function go_complementAutoObject($tt, obj) { if (is_function(obj.button)) { obj.button = obj.button.call($tt); } if (is_string(obj.button)) { obj.button = $(obj.button); } if (!is_boolean(obj.play)) { obj.play = true; } if (!is_number(obj.delay)) { obj.delay = 0; } if (is_undefined(obj.pauseOnEvent)) { obj.pauseOnEvent = true; } if (!is_boolean(obj.pauseOnResize)) { obj.pauseOnResize = true; } if (!is_number(obj.timeoutDuration)) { obj.timeoutDuration = (obj.duration < 10) ? 2500 : obj.duration * 5; } if (obj.progress) { if (is_function(obj.progress.bar)) { obj.progress.bar = obj.progress.bar.call($tt); } if (is_string(obj.progress.bar)) { obj.progress.bar = $(obj.progress.bar); } if (obj.progress.bar) { if (!is_function(obj.progress.updater)) { obj.progress.updater = $.fn.carouFredSel.progressbarUpdater; } if (!is_number(obj.progress.interval)) { obj.progress.interval = 50; } } else { obj.progress = false; } } return obj; } function go_getPrevNextObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'button': obj }; } else if (is_number(obj)) { obj = { 'key': obj }; } return obj; } function go_complementPrevNextObject($tt, obj) { if (is_function(obj.button)) { obj.button = obj.button.call($tt); } if (is_string(obj.button)) { obj.button = $(obj.button); } if (is_string(obj.key)) { obj.key = cf_getKeyCode(obj.key); } return obj; } function go_getPaginationObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'container': obj }; } else if (is_boolean(obj)) { obj = { 'keys': obj }; } return obj; } function go_complementPaginationObject($tt, obj) { if (is_function(obj.container)) { obj.container = obj.container.call($tt); } if (is_string(obj.container)) { obj.container = $(obj.container); } if (!is_number(obj.items)) { obj.items = false; } if (!is_boolean(obj.keys)) { obj.keys = false; } if (!is_function(obj.anchorBuilder) && !is_false(obj.anchorBuilder)) { obj.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder; } if (!is_number(obj.deviation)) { obj.deviation = 0; } return obj; } function go_getSwipeObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } if (is_undefined(obj)) { obj = { 'onTouch': false }; } if (is_true(obj)) { obj = { 'onTouch': obj }; } else if (is_number(obj)) { obj = { 'items': obj }; } return obj; } function go_complementSwipeObject($tt, obj) { if (!is_boolean(obj.onTouch)) { obj.onTouch = true; } if (!is_boolean(obj.onMouse)) { obj.onMouse = false; } if (!is_object(obj.options)) { obj.options = {}; } if (!is_boolean(obj.options.triggerOnTouchEnd)) { obj.options.triggerOnTouchEnd = false; } return obj; } function go_getMousewheelObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } if (is_true(obj)) { obj = {}; } else if (is_number(obj)) { obj = { 'items': obj }; } else if (is_undefined(obj)) { obj = false; } return obj; } function go_complementMousewheelObject($tt, obj) { return obj; } // get number functions function gn_getItemIndex(num, dev, org, items, $cfs) { if (is_string(num)) { num = $(num, $cfs); } if (is_object(num)) { num = $(num, $cfs); } if (is_jquery(num)) { num = $cfs.children().index(num); if (!is_boolean(org)) { org = false; } } else { if (!is_boolean(org)) { org = true; } } if (!is_number(num)) { num = 0; } if (!is_number(dev)) { dev = 0; } if (org) { num += items.first; } num += dev; if (items.total > 0) { while (num >= items.total) { num -= items.total; } while (num < 0) { num += items.total; } } return num; } // items prev function gn_getVisibleItemsPrev(i, o, s) { var t = 0, x = 0; for (var a = s; a >= 0; a--) { var j = i.eq(a); t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0; if (t > o.maxDimension) { return x; } if (a == 0) { a = i.length; } x++; } } function gn_getVisibleItemsPrevFilter(i, o, s) { return gn_getItemsPrevFilter(i, o.items.filter, o.items.visibleConf.org, s); } function gn_getScrollItemsPrevFilter(i, o, s, m) { return gn_getItemsPrevFilter(i, o.items.filter, m, s); } function gn_getItemsPrevFilter(i, f, m, s) { var t = 0, x = 0; for (var a = s, l = i.length; a >= 0; a--) { x++; if (x == l) { return x; } var j = i.eq(a); if (j.is(f)) { t++; if (t == m) { return x; } } if (a == 0) { a = l; } } } function gn_getVisibleOrg($c, o) { return o.items.visibleConf.org || $c.children().slice(0, o.items.visible).filter(o.items.filter).length; } // items next function gn_getVisibleItemsNext(i, o, s) { var t = 0, x = 0; for (var a = s, l = i.length-1; a <= l; a++) { var j = i.eq(a); t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0; if (t > o.maxDimension) { return x; } x++; if (x == l+1) { return x; } if (a == l) { a = -1; } } } function gn_getVisibleItemsNextTestCircular(i, o, s, l) { var v = gn_getVisibleItemsNext(i, o, s); if (!o.circular) { if (s + v > l) { v = l - s; } } return v; } function gn_getVisibleItemsNextFilter(i, o, s) { return gn_getItemsNextFilter(i, o.items.filter, o.items.visibleConf.org, s, o.circular); } function gn_getScrollItemsNextFilter(i, o, s, m) { return gn_getItemsNextFilter(i, o.items.filter, m+1, s, o.circular) - 1; } function gn_getItemsNextFilter(i, f, m, s, c) { var t = 0, x = 0; for (var a = s, l = i.length-1; a <= l; a++) { x++; if (x >= l) { return x; } var j = i.eq(a); if (j.is(f)) { t++; if (t == m) { return x; } } if (a == l) { a = -1; } } } // get items functions function gi_getCurrentItems(i, o) { return i.slice(0, o.items.visible); } function gi_getOldItemsPrev(i, o, n) { return i.slice(n, o.items.visibleConf.old+n); } function gi_getNewItemsPrev(i, o) { return i.slice(0, o.items.visible); } function gi_getOldItemsNext(i, o) { return i.slice(0, o.items.visibleConf.old); } function gi_getNewItemsNext(i, o, n) { return i.slice(n, o.items.visible+n); } // sizes functions function sz_storeMargin(i, o, d) { if (o.usePadding) { if (!is_string(d)) { d = '_cfs_origCssMargin'; } i.each(function() { var j = $(this), m = parseInt(j.css(o.d['marginRight']), 10); if (!is_number(m)) { m = 0; } j.data(d, m); }); } } function sz_resetMargin(i, o, m) { if (o.usePadding) { var x = (is_boolean(m)) ? m : false; if (!is_number(m)) { m = 0; } sz_storeMargin(i, o, '_cfs_tempCssMargin'); i.each(function() { var j = $(this); j.css(o.d['marginRight'], ((x) ? j.data('_cfs_tempCssMargin') : m + j.data('_cfs_origCssMargin'))); }); } } function sz_storeOrigCss(i) { i.each(function() { var j = $(this); j.data('_cfs_origCss', j.attr('style') || ''); }); } function sz_restoreOrigCss(i) { i.each(function() { var j = $(this); j.attr('style', j.data('_cfs_origCss') || ''); }); } function sz_setResponsiveSizes(o, all) { var visb = o.items.visible, newS = o.items[o.d['width']], seco = o[o.d['height']], secp = is_percentage(seco); all.each(function() { var $t = $(this), nw = newS - ms_getPaddingBorderMargin($t, o, 'Width'); $t[o.d['width']](nw); if (secp) { $t[o.d['height']](ms_getPercentage(nw, seco)); } }); } function sz_setSizes($c, o) { var $w = $c.parent(), $i = $c.children(), $v = gi_getCurrentItems($i, o), sz = cf_mapWrapperSizes(ms_getSizes($v, o, true), o, false); $w.css(sz); if (o.usePadding) { var p = o.padding, r = p[o.d[1]]; if (o.align && r < 0) { r = 0; } var $l = $v.last(); $l.css(o.d['marginRight'], $l.data('_cfs_origCssMargin') + r); $c.css(o.d['top'], p[o.d[0]]); $c.css(o.d['left'], p[o.d[3]]); } $c.css(o.d['width'], sz[o.d['width']]+(ms_getTotalSize($i, o, 'width')*2)); $c.css(o.d['height'], ms_getLargestSize($i, o, 'height')); return sz; } // measuring functions function ms_getSizes(i, o, wrapper) { return [ms_getTotalSize(i, o, 'width', wrapper), ms_getLargestSize(i, o, 'height', wrapper)]; } function ms_getLargestSize(i, o, dim, wrapper) { if (!is_boolean(wrapper)) { wrapper = false; } if (is_number(o[o.d[dim]]) && wrapper) { return o[o.d[dim]]; } if (is_number(o.items[o.d[dim]])) { return o.items[o.d[dim]]; } dim = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight'; return ms_getTrueLargestSize(i, o, dim); } function ms_getTrueLargestSize(i, o, dim) { var s = 0; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); var m = (j.is(':visible')) ? j[o.d[dim]](true) : 0; if (s < m) { s = m; } } return s; } function ms_getTotalSize(i, o, dim, wrapper) { if (!is_boolean(wrapper)) { wrapper = false; } if (is_number(o[o.d[dim]]) && wrapper) { return o[o.d[dim]]; } if (is_number(o.items[o.d[dim]])) { return o.items[o.d[dim]] * i.length; } var d = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight', s = 0; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); s += (j.is(':visible')) ? j[o.d[d]](true) : 0; } return s; } function ms_getParentSize($w, o, d) { var isVisible = $w.is(':visible'); if (isVisible) { $w.hide(); } var s = $w.parent()[o.d[d]](); if (isVisible) { $w.show(); } return s; } function ms_getMaxDimension(o, a) { return (is_number(o[o.d['width']])) ? o[o.d['width']] : a; } function ms_hasVariableSizes(i, o, dim) { var s = false, v = false; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); var c = (j.is(':visible')) ? j[o.d[dim]](true) : 0; if (s === false) { s = c; } else if (s != c) { v = true; } if (s == 0) { v = true; } } return v; } function ms_getPaddingBorderMargin(i, o, d) { return i[o.d['outer'+d]](true) - i[o.d[d.toLowerCase()]](); } function ms_getPercentage(s, o) { if (is_percentage(o)) { o = parseInt( o.slice(0, -1), 10 ); if (!is_number(o)) { return s; } s *= o/100; } return s; } // config functions function cf_e(n, c, pf, ns, rd) { if (!is_boolean(pf)) { pf = true; } if (!is_boolean(ns)) { ns = true; } if (!is_boolean(rd)) { rd = false; } if (pf) { n = c.events.prefix + n; } if (ns) { n = n +'.'+ c.events.namespace; } if (ns && rd) { n += c.serialNumber; } return n; } function cf_c(n, c) { return (is_string(c.classnames[n])) ? c.classnames[n] : n; } function cf_mapWrapperSizes(ws, o, p) { if (!is_boolean(p)) { p = true; } var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0]; var wra = {}; wra[o.d['width']] = ws[0] + pad[1] + pad[3]; wra[o.d['height']] = ws[1] + pad[0] + pad[2]; return wra; } function cf_sortParams(vals, typs) { var arr = []; for (var a = 0, l1 = vals.length; a < l1; a++) { for (var b = 0, l2 = typs.length; b < l2; b++) { if (typs[b].indexOf(typeof vals[a]) > -1 && is_undefined(arr[b])) { arr[b] = vals[a]; break; } } } return arr; } function cf_getPadding(p) { if (is_undefined(p)) { return [0, 0, 0, 0]; } if (is_number(p)) { return [p, p, p, p]; } if (is_string(p)) { p = p.split('px').join('').split('em').join('').split(' '); } if (!is_array(p)) { return [0, 0, 0, 0]; } for (var i = 0; i < 4; i++) { p[i] = parseInt(p[i], 10); } switch (p.length) { case 0: return [0, 0, 0, 0]; case 1: return [p[0], p[0], p[0], p[0]]; case 2: return [p[0], p[1], p[0], p[1]]; case 3: return [p[0], p[1], p[2], p[1]]; default: return [p[0], p[1], p[2], p[3]]; } } function cf_getAlignPadding(itm, o) { var x = (is_number(o[o.d['width']])) ? Math.ceil(o[o.d['width']] - ms_getTotalSize(itm, o, 'width')) : 0; switch (o.align) { case 'left': return [0, x]; case 'right': return [x, 0]; case 'center': default: return [Math.ceil(x/2), Math.floor(x/2)]; } } function cf_getDimensions(o) { var dm = [ ['width' , 'innerWidth' , 'outerWidth' , 'height' , 'innerHeight' , 'outerHeight' , 'left', 'top' , 'marginRight' , 0, 1, 2, 3], ['height' , 'innerHeight' , 'outerHeight' , 'width' , 'innerWidth' , 'outerWidth' , 'top' , 'left', 'marginBottom', 3, 2, 1, 0] ]; var dl = dm[0].length, dx = (o.direction == 'right' || o.direction == 'left') ? 0 : 1; var dimensions = {}; for (var d = 0; d < dl; d++) { dimensions[dm[0][d]] = dm[dx][d]; } return dimensions; } function cf_getAdjust(x, o, a, $t) { var v = x; if (is_function(a)) { v = a.call($t, v); } else if (is_string(a)) { var p = a.split('+'), m = a.split('-'); if (m.length > p.length) { var neg = true, sta = m[0], adj = m[1]; } else { var neg = false, sta = p[0], adj = p[1]; } switch(sta) { case 'even': v = (x % 2 == 1) ? x-1 : x; break; case 'odd': v = (x % 2 == 0) ? x-1 : x; break; default: v = x; break; } adj = parseInt(adj, 10); if (is_number(adj)) { if (neg) { adj = -adj; } v += adj; } } if (!is_number(v) || v < 1) { v = 1; } return v; } function cf_getItemsAdjust(x, o, a, $t) { return cf_getItemAdjustMinMax(cf_getAdjust(x, o, a, $t), o.items.visibleConf); } function cf_getItemAdjustMinMax(v, i) { if (is_number(i.min) && v < i.min) { v = i.min; } if (is_number(i.max) && v > i.max) { v = i.max; } if (v < 1) { v = 1; } return v; } function cf_getSynchArr(s) { if (!is_array(s)) { s = [[s]]; } if (!is_array(s[0])) { s = [s]; } for (var j = 0, l = s.length; j < l; j++) { if (is_string(s[j][0])) { s[j][0] = $(s[j][0]); } if (!is_boolean(s[j][1])) { s[j][1] = true; } if (!is_boolean(s[j][2])) { s[j][2] = true; } if (!is_number(s[j][3])) { s[j][3] = 0; } } return s; } function cf_getKeyCode(k) { if (k == 'right') { return 39; } if (k == 'left') { return 37; } if (k == 'up') { return 38; } if (k == 'down') { return 40; } return -1; } function cf_setCookie(n, $c, c) { if (n) { var v = $c.triggerHandler(cf_e('currentPosition', c)); $.fn.carouFredSel.cookie.set(n, v); } } function cf_getCookie(n) { var c = $.fn.carouFredSel.cookie.get(n); return (c == '') ? 0 : c; } // init function function in_mapCss($elem, props) { var css = {}; for (var p = 0, l = props.length; p < l; p++) { css[props[p]] = $elem.css(props[p]); } return css; } function in_complementItems(obj, opt, itm, sta) { if (!is_object(obj.visibleConf)) { obj.visibleConf = {}; } if (!is_object(obj.sizesConf)) { obj.sizesConf = {}; } if (obj.start == 0 && is_number(sta)) { obj.start = sta; } // visible items if (is_object(obj.visible)) { obj.visibleConf.min = obj.visible.min; obj.visibleConf.max = obj.visible.max; obj.visible = false; } else if (is_string(obj.visible)) { // variable visible items if (obj.visible == 'variable') { obj.visibleConf.variable = true; } // adjust string visible items else { obj.visibleConf.adjust = obj.visible; } obj.visible = false; } else if (is_function(obj.visible)) { obj.visibleConf.adjust = obj.visible; obj.visible = false; } // set items filter if (!is_string(obj.filter)) { obj.filter = (itm.filter(':hidden').length > 0) ? ':visible' : '*'; } // primary item-size not set if (!obj[opt.d['width']]) { // responsive carousel -> set to largest if (opt.responsive) { debug(true, 'Set a '+opt.d['width']+' for the items!'); obj[opt.d['width']] = ms_getTrueLargestSize(itm, opt, 'outerWidth'); } // non-responsive -> measure it or set to "variable" else { obj[opt.d['width']] = (ms_hasVariableSizes(itm, opt, 'outerWidth')) ? 'variable' : itm[opt.d['outerWidth']](true); } } // secondary item-size not set -> measure it or set to "variable" if (!obj[opt.d['height']]) { obj[opt.d['height']] = (ms_hasVariableSizes(itm, opt, 'outerHeight')) ? 'variable' : itm[opt.d['outerHeight']](true); } obj.sizesConf.width = obj.width; obj.sizesConf.height = obj.height; return obj; } function in_complementVisibleItems(opt, avl) { // primary item-size variable -> set visible items variable if (opt.items[opt.d['width']] == 'variable') { opt.items.visibleConf.variable = true; } if (!opt.items.visibleConf.variable) { // primary size is number -> calculate visible-items if (is_number(opt[opt.d['width']])) { opt.items.visible = Math.floor(opt[opt.d['width']] / opt.items[opt.d['width']]); } // measure and calculate primary size and visible-items else { opt.items.visible = Math.floor(avl / opt.items[opt.d['width']]); opt[opt.d['width']] = opt.items.visible * opt.items[opt.d['width']]; if (!opt.items.visibleConf.adjust) { opt.align = false; } } if (opt.items.visible == 'Infinity' || opt.items.visible < 1) { debug(true, 'Not a valid number of visible items: Set to "variable".'); opt.items.visibleConf.variable = true; } } return opt; } function in_complementPrimarySize(obj, opt, all) { // primary size set to auto -> measure largest item-size and set it if (obj == 'auto') { obj = ms_getTrueLargestSize(all, opt, 'outerWidth'); } return obj; } function in_complementSecondarySize(obj, opt, all) { // secondary size set to auto -> measure largest item-size and set it if (obj == 'auto') { obj = ms_getTrueLargestSize(all, opt, 'outerHeight'); } // secondary size not set -> set to secondary item-size if (!obj) { obj = opt.items[opt.d['height']]; } return obj; } function in_getAlignPadding(o, all) { var p = cf_getAlignPadding(gi_getCurrentItems(all, o), o); o.padding[o.d[1]] = p[1]; o.padding[o.d[3]] = p[0]; return o; } function in_getResponsiveValues(o, all, avl) { var visb = cf_getItemAdjustMinMax(Math.ceil(o[o.d['width']] / o.items[o.d['width']]), o.items.visibleConf); if (visb > all.length) { visb = all.length; } var newS = Math.floor(o[o.d['width']]/visb); o.items.visible = visb; o.items[o.d['width']] = newS; o[o.d['width']] = visb * newS; return o; } // buttons functions function bt_pauseOnHoverConfig(p) { if (is_string(p)) { var i = (p.indexOf('immediate') > -1) ? true : false, r = (p.indexOf('resume') > -1) ? true : false; } else { var i = r = false; } return [i, r]; } function bt_mousesheelNumber(mw) { return (is_number(mw)) ? mw : null } // helper functions function is_null(a) { return (a === null); } function is_undefined(a) { return (is_null(a) || typeof a == 'undefined' || a === '' || a === 'undefined'); } function is_array(a) { return (a instanceof Array); } function is_jquery(a) { return (a instanceof jQuery); } function is_object(a) { return ((a instanceof Object || typeof a == 'object') && !is_null(a) && !is_jquery(a) && !is_array(a) && !is_function(a)); } function is_number(a) { return ((a instanceof Number || typeof a == 'number') && !isNaN(a)); } function is_string(a) { return ((a instanceof String || typeof a == 'string') && !is_undefined(a) && !is_true(a) && !is_false(a)); } function is_function(a) { return (a instanceof Function || typeof a == 'function'); } function is_boolean(a) { return (a instanceof Boolean || typeof a == 'boolean' || is_true(a) || is_false(a)); } function is_true(a) { return (a === true || a === 'true'); } function is_false(a) { return (a === false || a === 'false'); } function is_percentage(x) { return (is_string(x) && x.slice(-1) == '%'); } function getTime() { return new Date().getTime(); } function deprecated( o, n ) { debug(true, o+' is DEPRECATED, support for it will be removed. Use '+n+' instead.'); } function debug(d, m) { if (!is_undefined(window.console) && !is_undefined(window.console.log)) { if (is_object(d)) { var s = ' ('+d.selector+')'; d = d.debug; } else { var s = ''; } if (!d) { return false; } if (is_string(m)) { m = 'carouFredSel'+s+': ' + m; } else { m = ['carouFredSel'+s+':', m]; } window.console.log(m); } return false; } // EASING FUNCTIONS $.extend($.easing, { 'quadratic': function(t) { var t2 = t * t; return t * (-t2 * t + 4 * t2 - 6 * t + 4); }, 'cubic': function(t) { return t * (4 * t * t - 9 * t + 6); }, 'elastic': function(t) { var t2 = t * t; return t * (33 * t2 * t2 - 106 * t2 * t + 126 * t2 - 67 * t + 15); } }); })(jQuery); // source --> https://crmtiger.com/wp-content/plugins/wp_icoonbox_plugin/js/iconbox.js?ver=4.3.26 (function($){ $(document).ready(function(){ icoonbox_grids = $('.icoonbox_grid'); icoonbox_grid_itemContainers = $('.icoonbox_grid.icoonbox_itemsBoxed .icoonbox_itemBg'); icoonbox_itemContainers = $('.icoonbox_itemContainer'); icoonbox_sliders = $('.icoonbox_slider'); // Grid items height setTimeout(function(){ icoonbox_grid_itemContainers.each(function(){ $(this).height( $(this).parent().parent().height() - $(this).parent().css('padding-top').replace('px', '') - $(this).parent().css('padding-bottom').replace('px', '') - ( $(this).css('borderWidth').replace('px', '')*2) ); }); },100); $(window).resize(function() { icoonbox_grid_itemContainers.height('100%'); icoonbox_grid_itemContainers.each(function(){ $(this).height( $(this).parent().parent().height() - $(this).parent().css('padding-top').replace('px', '') - $(this).parent().css('padding-bottom').replace('px', '') - ( $(this).css('borderWidth').replace('px', '')*2) ); }); }); // Grid cells width icoonbox_grids.each(function(){ icoonbox_grid_item_width = '50%'; if($(this).data('columns')==1) { icoonbox_grid_item_width = '100%'; } else if($(this).data('columns')==2) { icoonbox_grid_item_width = '50%'; } else if($(this).data('columns')==3) { icoonbox_grid_item_width = '33.3%'; } $(this).find('.icoonbox_cell').width(icoonbox_grid_item_width); }); // Hover Effect icoonbox_itemContainers.mouseenter(function(){ current_icoonbox = $(this).parents('.icoonbox'); if(current_icoonbox.data('hovericoncolor')) { $(this).find('i').stop().css({'color': current_icoonbox.data('hovericoncolor')}); } if(current_icoonbox.data('hovericonbgcolor')) { $(this).find('i').stop().css({'background-color': current_icoonbox.data('hovericonbgcolor')}); } if(current_icoonbox.data('hovericonbordercolor')) { $(this).find('i').stop().css({'border-color': current_icoonbox.data('hovericonbordercolor')}); } if(current_icoonbox.data('hovertitlecolor')) { $(this).find('.icoonbox_title, .icoonbox_title a').stop().css({'color': current_icoonbox.data('hovertitlecolor')}); } if(current_icoonbox.data('hoverdescriptioncolor')) { $(this).find('.icoonbox_description').stop().css({'color': current_icoonbox.data('hoverdescriptioncolor')}); } if(current_icoonbox.data('hovermorelinkcolor')) { $(this).find('.icoonbox_moreLink').stop().css({'color': current_icoonbox.data('hovermorelinkcolor')}); } if(current_icoonbox.data('hoverboxesbgcolor')) { $(this).find('.icoonbox_itemBg').stop().css({'background-color': current_icoonbox.data('hoverboxesbgcolor')}); } if(current_icoonbox.data('hoverboxesbordercolor')) { $(this).find('.icoonbox_itemBg').stop().css({'border-color': current_icoonbox.data('hoverboxesbordercolor')}); } }); icoonbox_itemContainers.mouseleave(function(){ current_icoonbox = $(this).parents('.icoonbox'); if(current_icoonbox.data('iconcolor')) { $(this).find('i').stop().css({'color': current_icoonbox.data('iconcolor')}); } if(current_icoonbox.data('iconbgcolor')) { $(this).find('i').stop().css({'background-color': current_icoonbox.data('iconbgcolor')}); } if(current_icoonbox.data('iconbordercolor')) { $(this).find('i').stop().css({'border-color': current_icoonbox.data('iconbordercolor')}); } if(current_icoonbox.data('titlefontcolor')) { $(this).find('.icoonbox_title, .icoonbox_title a').stop().css({'color': current_icoonbox.data('titlefontcolor')}); } if(current_icoonbox.data('textfontcolor')) { $(this).find('.icoonbox_description').stop().css({'color': current_icoonbox.data('textfontcolor')}); } if(current_icoonbox.data('morelinktextcolor')) { $(this).find('.icoonbox_moreLink').stop().css({'color': current_icoonbox.data('morelinktextcolor')}); } if(current_icoonbox.data('boxbgcolor')) { $(this).find('.icoonbox_itemBg').stop().css({'background-color': current_icoonbox.data('boxbgcolor')}); } if(current_icoonbox.data('boxesbordercolor')) { $(this).find('.icoonbox_itemBg').stop().css({'border-color': current_icoonbox.data('boxesbordercolor')}); } }); setTimeout(function(){ if (icoonbox_sliders.length ) { icoonbox_sliders.each(function(){ $(this).css('visibility','visible'); icoonbox_runSlider($(this)); }); } },1000); }); function icoonbox_runSlider(slider) { slider.children('.icoonbox_sliderItemsContainer').carouFredSel({ responsive: true, width:'100%', height:'variable', prev: { button: function() { return $(this).parent().parent().find(".icoonbox_prev"); } }, next: { button: function() { return $(this).parent().parent().find(".icoonbox_next"); } }, scroll: { items:1, easing:'quadratic', duration: slider.data('scrollduration') }, items: { width: 400, height: 'variable', visible: { min: 1, max: slider.data('columns') } }, auto: { play: slider.data('autoplay'), timeoutDuration: slider.data('pauseduration'), pauseOnHover: true }, swipe: { onMouse: false, onTouch: true } }); } })(jQuery);